comparison pylons_app/tests/functional/test_admin_settings.py @ 533:53aa1ee1af86

updated tests for new version 6char password etc...
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 01 Oct 2010 02:04:32 +0200
parents fefffd6fd5f4
children 12c976209b2e
comparison
equal deleted inserted replaced
532:946ed2955f48 533:53aa1ee1af86
76 76
77 new_email = 'new@mail.pl' 77 new_email = 'new@mail.pl'
78 response = self.app.post(url('admin_settings_my_account_update'), params=dict( 78 response = self.app.post(url('admin_settings_my_account_update'), params=dict(
79 _method='put', 79 _method='put',
80 username='test_admin', 80 username='test_admin',
81 new_password='test', 81 new_password='test12',
82 name='NewName', 82 name='NewName',
83 lastname='NewLastname', 83 lastname='NewLastname',
84 email=new_email,)) 84 email=new_email,))
85 print response 85 print response
86 86
89 89
90 new_email = 'test_regular@mail.com'#already exisitn email 90 new_email = 'test_regular@mail.com'#already exisitn email
91 response = self.app.post(url('admin_settings_my_account_update'), params=dict( 91 response = self.app.post(url('admin_settings_my_account_update'), params=dict(
92 _method='put', 92 _method='put',
93 username='test_admin', 93 username='test_admin',
94 new_password='test', 94 new_password='test12',
95 name='NewName', 95 name='NewName',
96 lastname='NewLastname', 96 lastname='NewLastname',
97 email=new_email,)) 97 email=new_email,))
98 print response 98 print response
99 99
100 assert 'That e-mail address is already taken' in response.body, 'Missing error message about existing email' 100 assert 'That e-mail address is already taken' in response.body, 'Missing error message about existing email'
101 101
102 102
103 def test_my_account_update_err(self): 103 def test_my_account_update_err(self):
104 self.log_user() 104 self.log_user('test_regular2', 'test12')
105 105
106 new_email = 'newmail.pl' 106 new_email = 'newmail.pl'
107 response = self.app.post(url('admin_settings_my_account_update'), params=dict( 107 response = self.app.post(url('admin_settings_my_account_update'), params=dict(
108 _method='put', 108 _method='put',
109 username='test_regular2', 109 username='test_admin',
110 new_password='test', 110 new_password='test12',
111 name='NewName', 111 name='NewName',
112 lastname='NewLastname', 112 lastname='NewLastname',
113 email=new_email,)) 113 email=new_email,))
114 print response 114 print response
115 assert 'An email address must contain a single @' in response.body, 'Missing error message about wrong email' 115 assert 'An email address must contain a single @' in response.body, 'Missing error message about wrong email'