summaryrefslogtreecommitdiff
path: root/tests/sites_framework
diff options
context:
space:
mode:
authorNick Pope <nick@nickpope.me.uk>2022-02-22 09:29:38 +0000
committerGitHub <noreply@github.com>2022-02-22 10:29:38 +0100
commit847f46e9bf88964484c8b76a10af753ea1018311 (patch)
tree13aced534cbae373f47cce8fce1444ad0e8e01d3 /tests/sites_framework
parent7ba6ebe9149ae38257d70100e8bfbfd0da189862 (diff)
Removed redundant QuerySet.all() calls in docs and tests.
Most QuerySet methods are mapped onto the Manager and, in general, it isn't necessary to call .all() on the manager.
Diffstat (limited to 'tests/sites_framework')
-rw-r--r--tests/sites_framework/tests.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/sites_framework/tests.py b/tests/sites_framework/tests.py
index bb0f79e5fe..4a297a9243 100644
--- a/tests/sites_framework/tests.py
+++ b/tests/sites_framework/tests.py
@@ -23,7 +23,7 @@ class SitesFrameworkTestCase(TestCase):
article = ExclusiveArticle.objects.create(
title="Breaking News!", site_id=settings.SITE_ID
)
- self.assertEqual(ExclusiveArticle.on_site.all().get(), article)
+ self.assertEqual(ExclusiveArticle.on_site.get(), article)
def test_sites_m2m(self):
article = SyndicatedArticle.objects.create(title="Fresh News!")
@@ -31,14 +31,14 @@ class SitesFrameworkTestCase(TestCase):
article.sites.add(Site.objects.get(id=settings.SITE_ID + 1))
article2 = SyndicatedArticle.objects.create(title="More News!")
article2.sites.add(Site.objects.get(id=settings.SITE_ID + 1))
- self.assertEqual(SyndicatedArticle.on_site.all().get(), article)
+ self.assertEqual(SyndicatedArticle.on_site.get(), article)
def test_custom_named_field(self):
article = CustomArticle.objects.create(
title="Tantalizing News!",
places_this_article_should_appear_id=settings.SITE_ID,
)
- self.assertEqual(CustomArticle.on_site.all().get(), article)
+ self.assertEqual(CustomArticle.on_site.get(), article)
@isolate_apps("sites_framework")