1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-08-21 16:47:22 +02:00

There was an error when an email was already used

This commit is contained in:
Yohann D'ANELLO
2020-12-04 01:25:17 +01:00
parent c658a9767d
commit de7f51d8da
2 changed files with 23 additions and 0 deletions

View File

@@ -119,6 +119,20 @@ class TestRegistration(TestCase):
self.assertRedirects(response, reverse("registration:email_validation_sent"), 302, 200)
self.assertTrue(User.objects.filter(email="toto@example.com").exists())
# Email is already used
response = self.client.post(reverse("registration:signup"), data=dict(
last_name="Toto",
first_name="Toto",
email="toto@example.com",
password1="azertyuiopazertyuiop",
password2="azertyuiopazertyuiop",
role="participant",
student_class=12,
school="God",
give_contact_to_animath=False,
))
self.assertEqual(response.status_code, 200)
response = self.client.get(reverse("registration:email_validation_sent"))
self.assertEqual(response.status_code, 200)