mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Refs #30325 -- Added tests for using count()/exists() with custom managers and reverse M2M relations.
This commit is contained in:
committed by
Mariusz Felisiak
parent
5f7991c42c
commit
9ac8520fcd
@@ -580,3 +580,9 @@ class ManyToManyTests(TestCase):
|
||||
]
|
||||
)
|
||||
self.assertQuerysetEqual(b.publications.all(), ['<Publication: Science Weekly>'])
|
||||
|
||||
def test_custom_default_manager_exists_count(self):
|
||||
a5 = Article.objects.create(headline='deleted')
|
||||
a5.publications.add(self.p2)
|
||||
self.assertEqual(self.p2.article_set.count(), self.p2.article_set.all().count())
|
||||
self.assertEqual(self.p3.article_set.exists(), self.p3.article_set.all().exists())
|
||||
|
||||
Reference in New Issue
Block a user