MCPcopy
hub / github.com/django/django / test_basic_alias_f_annotation

Method test_basic_alias_f_annotation

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

Source from the content-addressed store, hash-verified

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(
1372 another_rating=F("another_rating_alias")
1373 )
1374 self.assertIs(hasattr(qs.first(), "another_rating_alias"), False)
1375 for book in qs:
1376 with self.subTest(book=book):
1377 self.assertEqual(book.another_rating, book.rating)
1378
1379 def test_basic_alias_f_transform_annotation(self):
1380 qs = Book.objects.alias(

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected