adapt registration test to template changes (#37390)

This commit is contained in:
Paul Marillonnet 2019-10-31 15:01:31 +01:00 committed by Frédéric Péters
parent c8ce9fdd0a
commit 9d85720a87
1 changed files with 9 additions and 10 deletions

View File

@ -52,7 +52,7 @@ def test_registration(app, db, settings, mailoutbox, external_redirect):
else:
assert response.pyquery('a[href="/"]')
assert '2 days' in response.text
assert 'Follow the instructions' in response.text
assert 'testbot@entrouvert.com' in response.text
assert 'spam folder' in response.text
assert settings.DEFAULT_FROM_EMAIL in response.text
@ -119,9 +119,8 @@ def test_registration_realm(app, db, settings, mailoutbox):
assert urlparse(response['Location']).path == reverse('registration_complete')
response = response.follow()
assert '2 days' in response.text
assert 'Follow the instructions' in response.text
assert 'testbot@entrouvert.com' in response.text
assert '2 days' in response.text
assert len(mailoutbox) == 1
link = get_link_from_mail(mailoutbox[0])
@ -173,7 +172,7 @@ def test_username_settings(app, db, settings, mailoutbox):
assert urlparse(response['Location']).path == reverse('registration_complete')
response = response.follow()
assert '2 days' in response.text
assert 'Follow the instructions' in response.text
assert 'testbot@entrouvert.com' in response.text
assert len(mailoutbox) == 1
link = get_link_from_mail(mailoutbox[0])
@ -226,7 +225,7 @@ def test_username_is_unique(app, db, settings, mailoutbox):
assert urlparse(response['Location']).path == reverse('registration_complete')
response = response.follow()
assert '2 days' in response.text
assert 'Follow the instructions' in response.text
assert 'testbot@entrouvert.com' in response.text
assert len(mailoutbox) == 1
@ -272,7 +271,7 @@ def test_email_is_unique(app, db, settings, mailoutbox):
assert urlparse(response['Location']).path == reverse('registration_complete')
response = response.follow()
assert '2 days' in response.text
assert 'Follow the instructions' in response.text
assert 'testbot@entrouvert.com' in response.text
assert len(mailoutbox) == 1
@ -297,7 +296,7 @@ def test_email_is_unique(app, db, settings, mailoutbox):
assert urlparse(response['Location']).path == reverse('registration_complete')
response = response.follow()
assert '2 days' in response.text
assert 'Follow the instructions' in response.text
assert 'testbot@entrouvert.com' in response.text
assert not 'This email address is already in use.' in response.text
assert len(mailoutbox) == 3
@ -333,7 +332,7 @@ def test_attribute_model(app, db, settings, mailoutbox):
assert urlparse(response['Location']).path == reverse('registration_complete')
response = response.follow()
assert '2 days' in response.text
assert 'Follow the instructions' in response.text
assert 'testbot@entrouvert.com' in response.text
assert len(mailoutbox) == 1
@ -474,7 +473,7 @@ def test_revalidate_email(app, rf, db, settings, mailoutbox):
response = response.form.submit()
assert urlparse(response['Location']).path == reverse('registration_complete')
response = response.follow()
assert '2 days' in response.text
assert 'Follow the instructions' in response.text
assert 'johndoe@example.com' in response.text
assert len(mailoutbox) == 1
@ -552,7 +551,7 @@ def test_registration_redirect(app, db, settings, mailoutbox, external_redirect)
assert urlparse(response['Location']).path == reverse('registration_complete')
response = response.follow()
assert '2 days' in response.text
assert 'Follow the instructions' in response.text
assert 'testbot@entrouvert.com' in response.text
assert len(mailoutbox) == 1