Functional testing going crazy after turn on authkit

6 views
Skip to first unread message

Jan Koprowski

unread,
May 23, 2009, 1:57:15 PM5/23/09
to AuthKit
Hi !

Today I turn on in my project form,cookie authorization. Old code
run manualy request.environ['paste.auth_tkt.set_user']('username').
After I switched to form/cookie autorization with simple
autenticate.function my functional tests going crazy. When authkit is
turn off all is greate but after i turn on this (i use pylons 0.9.7
and nosetests) i get following:

No handlers could be found for logger "sqlalchemy.engine.base.Engine.
0x..8c"
.E
======================================================================
ERROR: Change password test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/app2/tests/functional/test_account.py", line 100, in
test_change_password_fail_bp_error
response.form['old_password'] = password
File "build/bdist.freebsd-6.2-RC1-i386/egg/webtest/__init__.py",
line 412, in form__get
File "build/bdist.freebsd-6.2-RC1-i386/egg/webtest/__init__.py",
line 402, in forms__get
File "build/bdist.freebsd-6.2-RC1-i386/egg/webtest/__init__.py",
line 452, in _parse_forms
File "build/bdist.freebsd-6.2-RC1-i386/egg/webtest/__init__.py",
line 927, in __init__
File "build/bdist.freebsd-6.2-RC1-i386/egg/webtest/__init__.py",
line 980, in _parse_fields
TypeError: __init__() keywords must be strings

----------------------------------------------------------------------
Ran 2 tests in 1.231s

FAILED (errors=1)

this test case look like:

def test_change_password_fail_bp_error(self):

"""Change password test"""

username = 'change_password_fail'
password = 'no_matter'
new_password = 'different_then_password'
environ = dict(
F_SIMULATION_RESULT='success',
S_SIMULATION_RESULT=S_SIMULATION_RESULT
)

response = self.app.get(url(controller='account',
action='index'))

response.form['old_password'] = password
response.form['new_password'] = new_password
response.form['new_password_confirmation'] = new_password

environ = dict(
F_SIMULATION_RESULT='fail',
REMOTE_USER=username,
SESSION=json.dumps({'userdata': {'uid':
S_SIMULATION_RESULT, 'password': password}})
)

response = response.form.submit(extra_environ=environ)
response = response.follow()

assert 'o.</li>' in response

Is any one now how I can do with this ? Debug or something ? I don't
have any idea ! I try almost anything. Thank You for any help.

Greetings from Poland
--
Jan Koprowski

Jan Koprowski

unread,
May 25, 2009, 4:45:01 AM5/25/09
to AuthKit
Problem solved !

url(controller='account', action='index') generate something wasn't
string I don't know what exactly.

Greetings from Poland !
--
Jan Koprowski
Reply all
Reply to author
Forward
0 new messages