Skip to content

Commit

Permalink
fix logout tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hirotasoshu authored and aleksihakli committed Apr 2, 2023
1 parent 6f629f6 commit 25f6903
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_access_log_on_logout(self):
self.login(is_valid_username=True, is_valid_password=True)
self.assertIsNone(AccessLog.objects.latest("id").logout_time)

response = self.client.get(reverse("admin:logout"))
response = self.client.post(reverse("admin:logout"))
self.assertContains(response, "Logged out")

self.assertIsNotNone(AccessLog.objects.latest("id").logout_time)
Expand All @@ -85,7 +85,7 @@ def test_valid_logout_without_success_log(self):
AccessLog.objects.all().delete()

response = self.login(is_valid_username=True, is_valid_password=True)
response = self.client.get(reverse("admin:logout"))
response = self.client.post(reverse("admin:logout"))

self.assertEqual(AccessLog.objects.all().count(), 0)
self.assertContains(response, "Logged out", html=True)
Expand All @@ -108,7 +108,7 @@ def test_valid_logout_without_log(self):
AccessLog.objects.all().delete()

response = self.login(is_valid_username=True, is_valid_password=True)
response = self.client.get(reverse("admin:logout"))
response = self.client.post(reverse("admin:logout"))

self.assertEqual(AccessLog.objects.count(), 0)
self.assertContains(response, "Logged out", html=True)
Expand Down

0 comments on commit 25f6903

Please sign in to comment.