Mercurial > kallithea
diff rhodecode/tests/functional/test_admin_settings.py @ 691:7486da5f0628 beta
Refactor codes for scm model
Some test updates, added test for admin user controller
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 14 Nov 2010 22:54:16 +0100 |
parents | 1e757ac98988 |
children | 18a3ca35d501 |
line wrap: on
line diff
--- a/rhodecode/tests/functional/test_admin_settings.py Sun Nov 14 22:18:51 2010 +0100 +++ b/rhodecode/tests/functional/test_admin_settings.py Sun Nov 14 22:54:16 2010 +0100 @@ -1,7 +1,7 @@ from rhodecode.tests import * from rhodecode.model.db import User -class TestSettingsController(TestController): +class TestAdminSettingsController(TestController): def test_index(self): response = self.app.get(url('admin_settings')) @@ -48,9 +48,9 @@ response = self.app.get(url('admin_settings_my_account')) print response assert 'value="test_admin' in response.body - - - + + + def test_my_account_update(self): self.log_user() new_email = 'new@mail.pl' @@ -64,16 +64,16 @@ email=new_email,)) response.follow() print response - + print 'x' * 100 print response.session assert 'Your account was updated succesfully' in response.session['flash'][0][1], 'no flash message about success of change' user = self.sa.query(User).filter(User.username == 'test_admin').one() assert user.email == new_email , 'incorrect user email after update got %s vs %s' % (user.email, new_email) - + def test_my_account_update_own_email_ok(self): self.log_user() - + new_email = 'new@mail.pl' response = self.app.post(url('admin_settings_my_account_update'), params=dict( _method='put', @@ -83,10 +83,10 @@ lastname='NewLastname', email=new_email,)) print response - + def test_my_account_update_err_email_exists(self): self.log_user() - + new_email = 'test_regular@mail.com'#already exisitn email response = self.app.post(url('admin_settings_my_account_update'), params=dict( _method='put', @@ -96,13 +96,13 @@ lastname='NewLastname', email=new_email,)) print response - + assert 'That e-mail address is already taken' in response.body, 'Missing error message about existing email' - - + + def test_my_account_update_err(self): self.log_user('test_regular2', 'test12') - + new_email = 'newmail.pl' response = self.app.post(url('admin_settings_my_account_update'), params=dict( _method='put',