MCPcopy
hub / github.com/django/django / test_ordering_select_related_collision

Method test_ordering_select_related_collision

tests/ordering/tests.py:669–685  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

667 )
668
669 def test_ordering_select_related_collision(self):
670 self.assertEqual(
671 Article.objects.select_related("author")
672 .annotate(name=Upper("author__name"))
673 .filter(pk=self.a1.pk)
674 .order_by(OrderBy(F("name")))
675 .first(),
676 self.a1,
677 )
678 self.assertEqual(
679 Article.objects.select_related("author")
680 .annotate(name=Upper("author__name"))
681 .filter(pk=self.a1.pk)
682 .order_by("name")
683 .first(),
684 self.a1,
685 )
686
687 def test_order_by_expr_query_reuse(self):
688 qs = Author.objects.annotate(num=Count("article")).order_by(

Callers

nothing calls this directly

Calls 8

UpperClass · 0.90
OrderByClass · 0.90
FClass · 0.90
firstMethod · 0.80
order_byMethod · 0.80
annotateMethod · 0.80
select_relatedMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected