Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 5, 2023
1 parent 5f6f223 commit 7a34825
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions simple_history/tests/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def test_history_view_pagination(self):
# Simulate a request to the second page
request = RequestFactory().get("/", {"page": "2"})
request.user = self.user

# Patch the render function
with patch("simple_history.admin.render") as mock_render:
admin.history_view(request, str(poll.id))
Expand All @@ -418,7 +418,9 @@ def test_history_view_pagination(self):
self.assertTrue(mock_render.called)

# Extract context passed to render function
action_list_count = mock_render.call_args[0][2]['action_list'].object_list.count()
action_list_count = mock_render.call_args[0][2][
"action_list"
].object_list.count()

# Check if only 10 (61 - 50 from the first page) objects are present in the context
self.assertEqual(action_list_count, 11)
Expand Down

0 comments on commit 7a34825

Please sign in to comment.