Commit 6546d00d authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

rm more obsolete tests about users / corporations CRUD

parent 52481b9c
......@@ -54,52 +54,12 @@ class ViewsTestCase(AdhesionsMixin, TestCase):
response = self.client.get(reverse("adhesion-detail"))
self.assertEqual(response.status_code, 200)
def test_corporation(self):
user = User.objects.get(username="user")
corp = Corporation.objects.get(social_reason="EvilCorp")
url = reverse("corporation-detail-user", kwargs={"pk": corp.pk})
response = self.client.get(url)
self.assertRedirects(response, reverse("login") + "?next=" + url)
self.client.login(username="user", password="user")
response = self.client.get(url)
self.assertEqual(response.status_code, 403)
corp.members.add(user)
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
self.assertContains(response, "")
def test_corporation_menu(self):
self.client.login(username="user", password="user")
response = self.client.get("/")
self.assertContains(response, "GoodCorp")
self.assertNotContains(response, "EvilCorp")
def test_users_admin(self):
self.client.login(username="admin", password="admin")
response = self.client.get(reverse("user-list"))
self.assertEqual(response.status_code, 200)
self.assertContains(response, "admin")
self.assertContains(response, "user")
response = self.client.get(reverse("user-add"))
self.assertEqual(response.status_code, 200)
response = self.client.get(reverse("user-detail", kwargs={"pk": 1}))
self.assertEqual(response.status_code, 200)
response = self.client.get(reverse("user-edit", kwargs={"pk": 1}))
self.assertEqual(response.status_code, 200)
def test_corporations_admin(self):
self.client.login(username="admin", password="admin")
response = self.client.get(reverse("corporation-list"))
self.assertEqual(response.status_code, 200)
self.assertContains(response, "GoodCorp")
self.assertContains(response, "EvilCorp")
response = self.client.get(reverse("corporation-add"))
self.assertEqual(response.status_code, 200)
response = self.client.get(reverse("corporation-detail", kwargs={"pk": 1}))
self.assertEqual(response.status_code, 200)
response = self.client.get(reverse("corporation-edit", kwargs={"pk": 1}))
self.assertEqual(response.status_code, 200)
def test_adhesions_urls(self):
self.client.login(username="admin", password="admin")
response = self.client.get(reverse("corporation-detail", kwargs={"pk": 1}))
......@@ -122,25 +82,6 @@ class ViewsTestCase(AdhesionsMixin, TestCase):
self.assertTrue(adh2.is_moral())
self.assertEqual(str(adh2), "GoodCorp")
def test_user_creation(self):
url = reverse("user-add")
self.client.login(username="user", password="user")
response = self.client.get(url)
self.assertRedirects(response, reverse("login") + "?next=" + url)
self.client.login(username="admin", password="admin")
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
def test_user_update(self):
user = User.objects.get(username="user")
url = reverse("user-edit", kwargs={"pk": user.pk})
self.client.login(username="user", password="user")
response = self.client.get(url)
self.assertRedirects(response, reverse("login") + "?next=" + url)
self.client.login(username="admin", password="admin")
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
class CommandsTestCase(AdhesionsMixin, TestCase):
def test_list(self):
......
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