MCPcopy
hub / github.com/django/django / test_basic_alias_annotation

Method test_basic_alias_annotation

tests/annotations/tests.py:1361–1368  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1359 self.assertIs(hasattr(qs.first(), "is_book"), False)
1360
1361 def test_basic_alias_annotation(self):
1362 qs = Book.objects.alias(
1363 is_book_alias=Value(1),
1364 ).annotate(is_book=F("is_book_alias"))
1365 self.assertIs(hasattr(qs.first(), "is_book_alias"), False)
1366 for book in qs:
1367 with self.subTest(book=book):
1368 self.assertEqual(book.is_book, 1)
1369
1370 def test_basic_alias_f_annotation(self):
1371 qs = Book.objects.alias(another_rating_alias=F("rating")).annotate(

Callers

nothing calls this directly

Calls 5

ValueClass · 0.90
FClass · 0.90
annotateMethod · 0.80
aliasMethod · 0.80
firstMethod · 0.80

Tested by

no test coverage detected