summaryrefslogtreecommitdiff
path: root/tests/admin_inlines
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/admin_inlines
parent7ba6ebe9149ae38257d70100e8bfbfd0da189862 (diff)
downloaddjango-847f46e9bf88964484c8b76a10af753ea1018311.tar.gz
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/admin_inlines')
-rw-r--r--tests/admin_inlines/tests.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py
index 91d69c8d17..b84faee190 100644
--- a/tests/admin_inlines/tests.py
+++ b/tests/admin_inlines/tests.py
@@ -1595,7 +1595,7 @@ class SeleniumTests(AdminSeleniumTestCase):
self.selenium.find_element(By.XPATH, '//input[@value="Save"]').click()
# The objects have been created in the database.
- self.assertEqual(Inner4Stacked.objects.all().count(), 4)
+ self.assertEqual(Inner4Stacked.objects.count(), 4)
def test_delete_invalid_tabular_inlines(self):
from selenium.common.exceptions import NoSuchElementException
@@ -1664,7 +1664,7 @@ class SeleniumTests(AdminSeleniumTestCase):
self.selenium.find_element(By.XPATH, '//input[@value="Save"]').click()
# The objects have been created in the database.
- self.assertEqual(Inner4Tabular.objects.all().count(), 4)
+ self.assertEqual(Inner4Tabular.objects.count(), 4)
def test_add_inlines(self):
"""
@@ -1750,8 +1750,8 @@ class SeleniumTests(AdminSeleniumTestCase):
self.selenium.find_element(By.XPATH, '//input[@value="Save"]').click()
# The objects have been created in the database
- self.assertEqual(ProfileCollection.objects.all().count(), 1)
- self.assertEqual(Profile.objects.all().count(), 3)
+ self.assertEqual(ProfileCollection.objects.count(), 1)
+ self.assertEqual(Profile.objects.count(), 3)
def test_add_inline_link_absent_for_view_only_parent_model(self):
from selenium.common.exceptions import NoSuchElementException