mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-21 03:58:26 +02:00
Fix broken tests
This commit is contained in:
@ -129,10 +129,18 @@ class TestRegistration(TestCase):
|
||||
role="participant",
|
||||
student_class=12,
|
||||
school="God",
|
||||
birth_date="2000-01-01",
|
||||
address="1 Rue de Rivoli, 75001 Paris, France",
|
||||
phone_number="0123456789",
|
||||
responsible_name="Toto",
|
||||
responsible_phone="0123456789",
|
||||
responsible_email="toto@example.com",
|
||||
give_contact_to_animath=False,
|
||||
))
|
||||
self.assertRedirects(response, reverse("registration:email_validation_sent"), 302, 200)
|
||||
self.assertTrue(User.objects.filter(email="toto@example.com").exists())
|
||||
self.assertTrue(User.objects.filter(
|
||||
email="toto@example.com",
|
||||
registration__participantregistration__studentregistration__responsible_name="Toto").exists())
|
||||
|
||||
# Email is already used
|
||||
response = self.client.post(reverse("registration:signup"), data=dict(
|
||||
@ -144,6 +152,12 @@ class TestRegistration(TestCase):
|
||||
role="participant",
|
||||
student_class=12,
|
||||
school="God",
|
||||
birth_date="2000-01-01",
|
||||
address="1 Rue de Rivoli, 75001 Paris, France",
|
||||
phone_number="0123456789",
|
||||
responsible_name="Toto",
|
||||
responsible_phone="0123456789",
|
||||
responsible_email="toto@example.com",
|
||||
give_contact_to_animath=False,
|
||||
))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
@ -158,6 +172,9 @@ class TestRegistration(TestCase):
|
||||
password1="azertyuiopazertyuiop",
|
||||
password2="azertyuiopazertyuiop",
|
||||
role="coach",
|
||||
birth_date="1980-01-01",
|
||||
address="1 Rue de Rivoli, 75001 Paris, France",
|
||||
phone_number="0123456789",
|
||||
professional_activity="God",
|
||||
give_contact_to_animath=True,
|
||||
))
|
||||
@ -234,8 +251,11 @@ class TestRegistration(TestCase):
|
||||
self.student.registration.save()
|
||||
|
||||
for user, data in [(self.user, dict(role="Bot")),
|
||||
(self.student, dict(student_class=11, school="Sky")),
|
||||
(self.coach, dict(professional_activity="God"))]:
|
||||
(self.student, dict(student_class=11, school="Sky", birth_date="2001-01-01",
|
||||
address="1 Rue de Rivoli, 75001 Paris, France", responsible_name="Toto",
|
||||
responsible_email="toto@example.com")),
|
||||
(self.coach, dict(professional_activity="God", birth_date="2001-01-01",
|
||||
address="1 Rue de Rivoli, 75001 Paris, France"))]:
|
||||
response = self.client.get(reverse("registration:update_user", args=(user.pk,)))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
@ -333,7 +353,8 @@ class TestRegistration(TestCase):
|
||||
response = self.client.get(reverse("registration:update_user", args=(self.user.pk,)))
|
||||
self.assertEqual(response.status_code, 403)
|
||||
|
||||
response = self.client.get(reverse("registration:upload_user_photo_authorization", args=(self.user.pk,)))
|
||||
response = self.client.get(reverse("registration:upload_user_photo_authorization",
|
||||
args=(self.student.registration.pk,)))
|
||||
self.assertEqual(response.status_code, 403)
|
||||
|
||||
response = self.client.get(reverse("photo_authorization", args=("inexisting-authorization",)))
|
||||
|
Reference in New Issue
Block a user