Commit 3dd9cc8f authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

update url in tests

parent 1a2c1a58
......@@ -34,17 +34,15 @@ class ViewsTestCase(TestCase):
def test_login_logout(self):
self.assertEqual(self.client.get(reverse("login")).status_code, 200)
self.client.login(username="user", password="user")
self.assertEqual(
self.client.get(reverse("adhesion-detail-user")).status_code, 200
)
self.assertEqual(self.client.get(reverse("adhesion-detail")).status_code, 200)
self.assertRedirects(
self.client.get(reverse("logout")),
reverse("adhesion-detail-user"),
reverse("adhesion-detail"),
target_status_code=302,
) # user page is redirected to login
self.assertRedirects(
self.client.get(reverse("adhesion-detail-user")),
reverse("login") + "?next=" + reverse("adhesion-detail-user"),
self.client.get(reverse("adhesion-detail")),
reverse("login") + "?next=" + reverse("adhesion-detail"),
)
def test_profile(self):
......
......@@ -53,12 +53,12 @@ class ViewsTestCase(AdhesionsMixin, TestCase):
)
def test_user(self):
response = self.client.get(reverse("adhesion-detail-user"))
response = self.client.get(reverse("adhesion-detail"))
self.assertRedirects(
response, reverse("login") + "?next=" + reverse("adhesion-detail-user")
response, reverse("login") + "?next=" + reverse("adhesion-detail")
)
self.client.login(username="user", password="user")
response = self.client.get(reverse("adhesion-detail-user"))
response = self.client.get(reverse("adhesion-detail"))
self.assertEqual(response.status_code, 200)
def test_corporation(self):
......
......@@ -52,7 +52,7 @@ class ServicesMixin:
class ViewsTestCase(ServicesMixin, TestCase):
def test_home_service_list(self):
self.client.login(username="user1", password="user1")
response = self.client.get(reverse("adhesion-detail-user"))
response = self.client.get(reverse("adhesion-detail"))
self.assertContains(response, "Service 1")
self.assertNotContains(response, "Service 2")
self.assertNotContains(response, "Service 3")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment