1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-26 18:37:12 +00:00

Tests are better when they work (fix two tests)

This commit is contained in:
Yohann D'ANELLO 2020-08-11 01:07:45 +02:00
parent b7a88a387c
commit 106e97f5df

View File

@ -307,7 +307,7 @@ class TestWEIRegistration(TestCase):
roles=[], roles=[],
)) ))
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertFalse(response.context["form"].is_valid()) self.assertFalse(response.context["membership_form"].is_valid())
response = self.client.post(reverse("wei:wei_register_2A", kwargs=dict(wei_pk=self.wei.pk)), dict( response = self.client.post(reverse("wei:wei_register_2A", kwargs=dict(wei_pk=self.wei.pk)), dict(
user=user.id, user=user.id,
@ -490,7 +490,7 @@ class TestWEIRegistration(TestCase):
# Check that if the WEI is started, we can't update a registration # Check that if the WEI is started, we can't update a registration
self.wei.date_start = '2000-01-01' self.wei.date_start = '2000-01-01'
self.wei.save() self.wei.save()
response = self.client.get(reverse("wei:wei_update_registration", kwargs=dict(wei_pk=self.registration.pk))) response = self.client.get(reverse("wei:validate_registration", kwargs=dict(pk=self.registration.pk)))
self.assertRedirects(response, reverse("wei:wei_closed", kwargs=dict(pk=self.wei.pk)), 302, 200) self.assertRedirects(response, reverse("wei:wei_closed", kwargs=dict(pk=self.wei.pk)), 302, 200)
def test_delete_registration(self): def test_delete_registration(self):