diff options
author | Emad Mokhtar <emad.m.habib@gmail.com> | 2016-06-07 14:24:19 +0300 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2016-06-08 14:09:24 -0400 |
commit | c4980e28e57f385d8ffed5e32ce373e52ce61049 (patch) | |
tree | 7193033375ec8247541f0ee26fc42670a896ec5d /tests/sitemaps_tests | |
parent | 724dd2043ec849e605ba4f4cf1430458c2a8d90a (diff) | |
download | django-c4980e28e57f385d8ffed5e32ce373e52ce61049.tar.gz |
Fixed #26290 -- Warned that paginating an unordered QuerySet may result in inconsistent results.
Diffstat (limited to 'tests/sitemaps_tests')
-rw-r--r-- | tests/sitemaps_tests/test_http.py | 2 | ||||
-rw-r--r-- | tests/sitemaps_tests/urls/http.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/sitemaps_tests/test_http.py b/tests/sitemaps_tests/test_http.py index aac4d69a20..33599e9ed9 100644 --- a/tests/sitemaps_tests/test_http.py +++ b/tests/sitemaps_tests/test_http.py @@ -194,7 +194,7 @@ class HTTPSitemapTests(SitemapTestsBase): Check to make sure that the raw item is included with each Sitemap.get_url() url result. """ - test_sitemap = GenericSitemap({'queryset': TestModel.objects.all()}) + test_sitemap = GenericSitemap({'queryset': TestModel.objects.order_by('pk').all()}) def is_testmodel(url): return isinstance(url['item'], TestModel) diff --git a/tests/sitemaps_tests/urls/http.py b/tests/sitemaps_tests/urls/http.py index 72e14d5e7f..e2fc991a29 100644 --- a/tests/sitemaps_tests/urls/http.py +++ b/tests/sitemaps_tests/urls/http.py @@ -27,7 +27,7 @@ class SimpleI18nSitemap(Sitemap): i18n = True def items(self): - return I18nTestModel.objects.all() + return I18nTestModel.objects.order_by('pk').all() class EmptySitemap(Sitemap): @@ -115,7 +115,7 @@ sitemaps_lastmod_descending = OrderedDict([ ]) generic_sitemaps = { - 'generic': GenericSitemap({'queryset': TestModel.objects.all()}), + 'generic': GenericSitemap({'queryset': TestModel.objects.order_by('pk').all()}), } |