MCPcopy
hub / github.com/django/django / test_wrong_model

Method test_wrong_model

tests/queries/test_contains.py:54–62  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

52 self.assertIs(ProxyCategory.objects.contains(self.category), True)
53
54 def test_wrong_model(self):
55 qs = DumbCategory.objects.all()
56 named_category = NamedCategory(name="category")
57 with self.assertNumQueries(0):
58 self.assertIs(qs.contains(named_category), False)
59 # Evaluate the queryset.
60 list(qs)
61 with self.assertNumQueries(0):
62 self.assertIs(qs.contains(named_category), False)

Callers

nothing calls this directly

Calls 4

NamedCategoryClass · 0.85
assertNumQueriesMethod · 0.80
allMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected