File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import collections .abc
22import inspect
3+ import pathlib
34import unittest .mock
45import warnings
56from datetime import datetime
@@ -888,7 +889,11 @@ async def test_paginating_unordered_queryset_raises_warning_async(self):
888889 AsyncPaginator (Article .objects .all (), 5 )
889890 # The warning points at the BasePaginator caller.
890891 # The reason is that the UnorderedObjectListWarning occurs in BasePaginator.
891- self .assertEqual (cm .filename , inspect .getfile (BasePaginator ))
892+ base_paginator_path = pathlib .Path (inspect .getfile (BasePaginator ))
893+ self .assertIn (
894+ cm .filename ,
895+ [str (base_paginator_path ), str (base_paginator_path .with_suffix (".py" ))],
896+ )
892897
893898 def test_paginating_empty_queryset_does_not_warn (self ):
894899 with warnings .catch_warnings (record = True ) as recorded :
You can’t perform that action at this time.
0 commit comments