MCPcopy
hub / github.com/django/django / test_fk_reuse_annotation

Method test_fk_reuse_annotation

tests/queries/tests.py:3893–3895  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3891 self.assertEqual(str(qs.query).count("JOIN"), 1)
3892
3893 def test_fk_reuse_annotation(self):
3894 qs = Annotation.objects.filter(tag__name="foo").annotate(cnt=Count("tag__name"))
3895 self.assertEqual(str(qs.query).count("JOIN"), 1)
3896
3897 def test_fk_reuse_disjunction(self):
3898 qs = Annotation.objects.filter(Q(tag__name="foo") | Q(tag__name="bar"))

Callers

nothing calls this directly

Calls 4

CountClass · 0.90
annotateMethod · 0.80
filterMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected