mirror of
https://github.com/django/django.git
synced 2025-03-24 00:00:45 +00:00
Refs #35945 -- Fixed test_paginating_unordered_queryset_raises_warning_async() test on byte-compiled Django.
This commit is contained in:
parent
e03440291b
commit
e7a9d756ee
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user