| 1680 | self.assertCountEqual(seasons, Season.objects.all()) |
| 1681 | |
| 1682 | def test_nested_outerref_lhs(self): |
| 1683 | tag = Tag.objects.create(name=self.au1.alias) |
| 1684 | tag.articles.add(self.a1) |
| 1685 | qs = Tag.objects.annotate( |
| 1686 | has_author_alias_match=Exists( |
| 1687 | Article.objects.annotate( |
| 1688 | author_exists=Exists( |
| 1689 | Author.objects.filter(alias=OuterRef(OuterRef("name"))) |
| 1690 | ), |
| 1691 | ).filter(author_exists=True) |
| 1692 | ), |
| 1693 | ) |
| 1694 | self.assertEqual(qs.get(has_author_alias_match=True), tag) |
| 1695 | |
| 1696 | def test_exact_query_rhs_with_selected_columns(self): |
| 1697 | newest_author = Author.objects.create(name="Author 2") |