summaryrefslogtreecommitdiff
path: root/tests/pagination/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pagination/tests.py')
-rw-r--r--tests/pagination/tests.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/pagination/tests.py b/tests/pagination/tests.py
index ab2329f26f..67a33cd41d 100644
--- a/tests/pagination/tests.py
+++ b/tests/pagination/tests.py
@@ -1,5 +1,6 @@
import collections.abc
import inspect
+import pathlib
import unittest.mock
import warnings
from datetime import datetime
@@ -888,7 +889,11 @@ class ModelPaginationTests(TestCase):
AsyncPaginator(Article.objects.all(), 5)
# The warning points at the BasePaginator caller.
# The reason is that the UnorderedObjectListWarning occurs in BasePaginator.
- self.assertEqual(cm.filename, inspect.getfile(BasePaginator))
+ base_paginator_path = pathlib.Path(inspect.getfile(BasePaginator))
+ self.assertIn(
+ cm.filename,
+ [str(base_paginator_path), str(base_paginator_path.with_suffix(".py"))],
+ )
def test_paginating_empty_queryset_does_not_warn(self):
with warnings.catch_warnings(record=True) as recorded: