741 |
741 |
assert response.request.query_string == 'next=/manage/'
|
742 |
742 |
|
743 |
743 |
|
744 |
|
def test_manager_create_user_next_url(superuser_or_admin, app, ou1):
|
|
744 |
def test_manager_create_user_next(superuser_or_admin, app, ou1):
|
745 |
745 |
next_url = u'https://example.nowhere.null/'
|
746 |
|
url = u'/manage/users/%s/add/?next_url=%s' % (ou1.pk, next_url)
|
|
746 |
url = u'/manage/users/%s/add/?next=%s' % (ou1.pk, next_url)
|
747 |
747 |
login(app, superuser_or_admin, '/manage/')
|
748 |
748 |
response = app.get(url)
|
749 |
749 |
form = response.form
|
... | ... | |
755 |
755 |
assert form.submit().location == next_url
|
756 |
756 |
|
757 |
757 |
|
758 |
|
def test_manager_create_user_next_url_form_cancelation(superuser_or_admin, app, ou1):
|
|
758 |
def test_manager_create_user_next_form_cancelation(superuser_or_admin, app, ou1):
|
759 |
759 |
next_url = u'https://example.nowhere.null/'
|
760 |
|
url = u'/manage/users/%s/add/?next_url=%s' % (ou1.pk, next_url)
|
|
760 |
url = u'/manage/users/%s/add/?next=%s' % (ou1.pk, next_url)
|
761 |
761 |
login(app, superuser_or_admin, '/manage/')
|
762 |
762 |
response = app.get(url)
|
763 |
763 |
form = response.form
|
... | ... | |
769 |
769 |
assert form.submit('cancel').location == next_url
|
770 |
770 |
|
771 |
771 |
|
772 |
|
def test_manager_create_user_next_url_form_error(superuser_or_admin, app, ou1):
|
|
772 |
def test_manager_create_user_next_form_error(superuser_or_admin, app, ou1):
|
773 |
773 |
next_url = u'https://example.nowhere.null/'
|
774 |
|
url = u'/manage/users/%s/add/?next_url=%s' % (ou1.pk, next_url)
|
|
774 |
url = u'/manage/users/%s/add/?next=%s' % (ou1.pk, next_url)
|
775 |
775 |
login(app, superuser_or_admin, '/manage/')
|
776 |
776 |
response = app.get(url)
|
777 |
777 |
form = response.form
|
... | ... | |
779 |
779 |
form.set('last_name', 'Doe')
|
780 |
780 |
form.set('email', 'jd') # erroneous
|
781 |
781 |
form.set('password1', 'notvalid') # erroneous
|
782 |
|
assert '<input type="hidden" name="next_url" value="%s">' % next_url in form.submit().body
|
|
782 |
assert '<input type="hidden" name="next" value="%s">' % next_url in form.submit().body
|
783 |
|
-
|