mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-08-21 16:47:22 +02:00
We can only register during the first phase
This commit is contained in:
@@ -84,26 +84,16 @@ class TestRegistration(TestCase):
|
||||
"""
|
||||
Ensure that the signup form is working successfully.
|
||||
"""
|
||||
response = self.client.get(reverse("registration:signup"))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# After first phase
|
||||
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:signup"))
|
||||
self.assertEqual(response.status_code, 403)
|
||||
|
||||
Phase.objects.filter(phase_number__gte=2).update(start=timezone.now() + timedelta(days=1),
|
||||
end=timezone.now() + timedelta(days=2))
|
||||
|
||||
response = self.client.get(reverse("registration:signup"))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
# Incomplete form
|
||||
response = self.client.post(reverse("registration:signup"), data=dict(
|
||||
last_name="Toto",
|
||||
|
Reference in New Issue
Block a user