Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-b committed Aug 12, 2024
1 parent e2d70e7 commit 6927efc
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/test_admin_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,13 @@ def test_search(self):
self.assertEqual(response.context["query_string"], "Hello")

def test_pagination(self):
pages = ["0", "1", "-1", "9999", "Not a page"]
for page in pages:
response = self.get({"p": page})
self.assertEqual(response.status_code, 200)

def test_ordering(self):
orderings = ["title", "-created_at"]
for ordering in orderings:
response = self.get({"ordering": ordering})
self.assertEqual(response.status_code, 200)
# page numbers in range should be accepted
response = self.get({"p": 1})
self.assertEqual(response.status_code, 200)
# page numbers out of range should return 404
response = self.get({"p": 9999})
self.assertEqual(response.status_code, 404)



class TestVideoAddView(TestCase, WagtailTestUtils):
Expand Down

0 comments on commit 6927efc

Please sign in to comment.