annotate rhodecode/tests/functional/test_admin_settings.py @ 1057:af6ca51fb80f

rhodecode release 1.1.3 changes
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 16 Feb 2011 11:05:35 +0100
parents 51127b2efb33
children ead7be02283b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
754
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
1 from rhodecode.lib.auth import get_crypt_password, check_password
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
2 from rhodecode.model.db import User
547
1e757ac98988 renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents: 534
diff changeset
3 from rhodecode.tests import *
346
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4
691
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
5 class TestAdminSettingsController(TestController):
346
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7 def test_index(self):
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8 response = self.app.get(url('admin_settings'))
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9 # Test response...
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11 def test_index_as_xml(self):
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12 response = self.app.get(url('formatted_admin_settings', format='xml'))
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
13
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
14 def test_create(self):
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15 response = self.app.post(url('admin_settings'))
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
16
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
17 def test_new(self):
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
18 response = self.app.get(url('admin_new_setting'))
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
19
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
20 def test_new_as_xml(self):
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
21 response = self.app.get(url('formatted_admin_new_setting', format='xml'))
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
22
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
23 def test_update(self):
459
7c978511c951 implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents: 346
diff changeset
24 response = self.app.put(url('admin_setting', setting_id=1))
346
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
25
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
26 def test_update_browser_fakeout(self):
459
7c978511c951 implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents: 346
diff changeset
27 response = self.app.post(url('admin_setting', setting_id=1), params=dict(_method='put'))
346
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
28
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
29 def test_delete(self):
459
7c978511c951 implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents: 346
diff changeset
30 response = self.app.delete(url('admin_setting', setting_id=1))
346
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
31
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
32 def test_delete_browser_fakeout(self):
459
7c978511c951 implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents: 346
diff changeset
33 response = self.app.post(url('admin_setting', setting_id=1), params=dict(_method='delete'))
346
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
34
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
35 def test_show(self):
459
7c978511c951 implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents: 346
diff changeset
36 response = self.app.get(url('admin_setting', setting_id=1))
346
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
37
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
38 def test_show_as_xml(self):
459
7c978511c951 implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents: 346
diff changeset
39 response = self.app.get(url('formatted_admin_setting', setting_id=1, format='xml'))
346
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
40
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
41 def test_edit(self):
459
7c978511c951 implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents: 346
diff changeset
42 response = self.app.get(url('admin_edit_setting', setting_id=1))
346
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
43
51362853ac3b added settings rest controllers for admin, updated routes with easier submodule handling
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
44 def test_edit_as_xml(self):
459
7c978511c951 implemented basic (startup) nose test suite.
Marcin Kuzminski <marcin@python-works.com>
parents: 346
diff changeset
45 response = self.app.get(url('formatted_admin_edit_setting', setting_id=1, format='xml'))
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
46
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
47 def test_my_account(self):
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
48 self.log_user()
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
49 response = self.app.get(url('admin_settings_my_account'))
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
50 print response
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
51 assert 'value="test_admin' in response.body
691
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
52
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
53
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
54
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
55 def test_my_account_update(self):
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
56 self.log_user()
754
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
57
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
58 new_email = 'new@mail.pl'
754
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
59 new_name = 'NewName'
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
60 new_lastname = 'NewLastname'
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
61 new_password = 'test123'
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
62
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
63
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
64 response = self.app.post(url('admin_settings_my_account_update'), params=dict(
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
65 _method='put',
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
66 username='test_admin',
754
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
67 new_password=new_password,
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
68 password='',
754
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
69 name=new_name,
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
70 lastname=new_lastname,
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
71 email=new_email,))
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
72 response.follow()
691
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
73
782
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 754
diff changeset
74 assert 'Your account was updated successfully' in response.session['flash'][0][1], 'no flash message about success of change'
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
75 user = self.sa.query(User).filter(User.username == 'test_admin').one()
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
76 assert user.email == new_email , 'incorrect user email after update got %s vs %s' % (user.email, new_email)
754
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
77 assert user.name == new_name, 'updated field mismatch %s vs %s' % (user.name, new_name)
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
78 assert user.lastname == new_lastname, 'updated field mismatch %s vs %s' % (user.lastname, new_lastname)
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
79 assert check_password(new_password, user.password) is True, 'password field mismatch %s vs %s' % (user.password, new_password)
691
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
80
754
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
81 #bring back the admin settings
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
82 old_email = 'test_admin@mail.com'
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
83 old_name = 'RhodeCode'
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
84 old_lastname = 'Admin'
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
85 old_password = 'test12'
691
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
86
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
87 response = self.app.post(url('admin_settings_my_account_update'), params=dict(
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
88 _method='put',
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
89 username='test_admin',
754
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
90 new_password=old_password,
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
91 password='',
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
92 name=old_name,
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
93 lastname=old_lastname,
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
94 email=old_email,))
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
95
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
96 response.follow()
782
51127b2efb33 fixed broken test after latest changes
Marcin Kuzminski <marcin@python-works.com>
parents: 754
diff changeset
97 assert 'Your account was updated successfully' in response.session['flash'][0][1], 'no flash message about success of change'
754
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
98 user = self.sa.query(User).filter(User.username == 'test_admin').one()
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
99 assert user.email == old_email , 'incorrect user email after update got %s vs %s' % (user.email, old_email)
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
100
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
101 assert user.email == old_email , 'incorrect user email after update got %s vs %s' % (user.email, old_email)
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
102 assert user.name == old_name, 'updated field mismatch %s vs %s' % (user.name, old_name)
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
103 assert user.lastname == old_lastname, 'updated field mismatch %s vs %s' % (user.lastname, old_lastname)
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
104 assert check_password(old_password, user.password) is True , 'password updated field mismatch %s vs %s' % (user.password, old_password)
101a407827e8 fixed test that broke admin email address
Marcin Kuzminski <marcin@python-works.com>
parents: 746
diff changeset
105
691
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
106
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
107 def test_my_account_update_err_email_exists(self):
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
108 self.log_user()
691
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
109
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
110 new_email = 'test_regular@mail.com'#already exisitn email
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
111 response = self.app.post(url('admin_settings_my_account_update'), params=dict(
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
112 _method='put',
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
113 username='test_admin',
533
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 491
diff changeset
114 new_password='test12',
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
115 name='NewName',
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
116 lastname='NewLastname',
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
117 email=new_email,))
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
118 print response
691
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
119
746
18a3ca35d501 fixed grammar in taken email error
Marcin Kuzminski <marcin@python-works.com>
parents: 691
diff changeset
120 assert 'This e-mail address is already taken' in response.body, 'Missing error message about existing email'
691
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
121
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
122
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
123 def test_my_account_update_err(self):
533
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 491
diff changeset
124 self.log_user('test_regular2', 'test12')
691
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
125
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
126 new_email = 'newmail.pl'
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
127 response = self.app.post(url('admin_settings_my_account_update'), params=dict(
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
128 _method='put',
533
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 491
diff changeset
129 username='test_admin',
53aa1ee1af86 updated tests for new version 6char password etc...
Marcin Kuzminski <marcin@python-works.com>
parents: 491
diff changeset
130 new_password='test12',
491
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
131 name='NewName',
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
132 lastname='NewLastname',
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
133 email=new_email,))
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
134 print response
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
135 assert 'An email address must contain a single @' in response.body, 'Missing error message about wrong email'
fefffd6fd5f4 Added some more tests, rewrite testing schema, to autogenerate fresh db, new index.
Marcin Kuzminski <marcin@python-works.com>
parents: 459
diff changeset
136 assert 'This username already exists' in response.body, 'Missing error message about existing user'