Mercurial > kallithea
changeset 534:12c976209b2e
fixed test for new version 100% test are ok
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Fri, 01 Oct 2010 02:19:34 +0200 |
parents | 53aa1ee1af86 |
children | 72778dda34cf |
files | pylons_app/tests/__init__.py pylons_app/tests/functional/test_admin_settings.py pylons_app/tests/functional/test_login.py pylons_app/tests/functional/test_settings.py |
diffstat | 4 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/pylons_app/tests/__init__.py Fri Oct 01 02:04:32 2010 +0200 +++ b/pylons_app/tests/__init__.py Fri Oct 01 02:19:34 2010 +0200 @@ -46,6 +46,11 @@ response = self.app.post(url(controller='login', action='index'), {'username':username, 'password':password}) + print response + + if 'invalid user name' in response.body: + assert False, 'could not login using %s %s' % (username, password) + assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status assert response.session['hg_app_user'].username == username, 'wrong logged in user got %s expected %s' % (response.session['hg_app_user'].username, username) return response.follow()
--- a/pylons_app/tests/functional/test_admin_settings.py Fri Oct 01 02:04:32 2010 +0200 +++ b/pylons_app/tests/functional/test_admin_settings.py Fri Oct 01 02:19:34 2010 +0200 @@ -57,7 +57,7 @@ response = self.app.post(url('admin_settings_my_account_update'), params=dict( _method='put', username='test_admin', - new_password='test', + new_password='test12', password='', name='NewName', lastname='NewLastname',
--- a/pylons_app/tests/functional/test_login.py Fri Oct 01 02:04:32 2010 +0200 +++ b/pylons_app/tests/functional/test_login.py Fri Oct 01 02:19:34 2010 +0200 @@ -13,7 +13,7 @@ def test_login_admin_ok(self): response = self.app.post(url(controller='login', action='index'), {'username':'test_admin', - 'password':'test'}) + 'password':'test12'}) assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status assert response.session['hg_app_user'].username == 'test_admin', 'wrong logged in user' response = response.follow() @@ -22,7 +22,7 @@ def test_login_regular_ok(self): response = self.app.post(url(controller='login', action='index'), {'username':'test_regular', - 'password':'test'}) + 'password':'test12'}) print response assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status assert response.session['hg_app_user'].username == 'test_regular', 'wrong logged in user' @@ -34,7 +34,7 @@ test_came_from = '/_admin/users' response = self.app.post(url(controller='login', action='index', came_from=test_came_from), {'username':'test_admin', - 'password':'test'}) + 'password':'test12'}) assert response.status == '302 Found', 'Wrong response code from came from redirection' response = response.follow()
--- a/pylons_app/tests/functional/test_settings.py Fri Oct 01 02:04:32 2010 +0200 +++ b/pylons_app/tests/functional/test_settings.py Fri Oct 01 02:19:34 2010 +0200 @@ -41,7 +41,6 @@ #test if fork is visible in the list ? - response.follow() + response = response.follow() print response - assert False