0001-manager-test-force-sending-email-for-generated-passw.patch
tests/test_user_manager.py | ||
---|---|---|
131 | 131 |
assert len(table) == (user_count + 1) |
132 | 132 |
assert len(table[0]) == (15 + AT_COUNT) |
133 | 133 | |
134 | ||
135 |
def test_manager_user_generate_password(app, superuser_or_admin, simple_user, mailoutbox): |
|
136 |
response = login(app, superuser_or_admin, |
|
137 |
reverse('a2-manager-user-by-uuid-detail', |
|
138 |
kwargs={'slug': simple_user.uuid})) |
|
139 |
assert 'Change user password' in response.content |
|
140 |
# cannot click it's a submit button :/ |
|
141 |
response = app.get(reverse('a2-manager-user-by-uuid-change-password', |
|
142 |
kwargs={'slug': simple_user.uuid})) |
|
143 |
assert response.form['generate_password'].value is None |
|
144 |
response.form.set('generate_password', '1') |
|
145 |
assert len(mailoutbox) == 0 |
|
146 |
response = response.form.submit().follow() |
|
147 |
assert '<li class="success">New password sent to user@example.net</li>' in response.content |
|
148 |
# cannot click it's a submit button :/ |
|
149 |
assert len(mailoutbox) == 1 |
|
150 |
assert u'An administrator has changed your password, it is now' in mailoutbox[0].body |
|
134 |
- |