diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py
index 44c0f0c..ff407d2 100644
a
|
b
|
class AggregationTests(TestCase):
|
1020 | 1020 | {'book__count__max': 2} |
1021 | 1021 | ) |
1022 | 1022 | |
| 1023 | def test_reverse_filter(self): |
| 1024 | # foreign key |
| 1025 | qs = Author.objects.annotate(contact_book_pages=Sum('book_contact_set__pages')) |
| 1026 | qs = qs.filter(name='Peter Norvig') |
| 1027 | qs2 = qs.filter(book_contact_set__pages__gte=0) |
| 1028 | self.assertEquals(qs[0].contact_book_pages, qs2[0].contact_book_pages) |
| 1029 | # m2m |
| 1030 | qs = Author.objects.annotate(pages_written=Sum('book__pages')) |
| 1031 | qs = qs.filter(name='Peter Norvig') |
| 1032 | qs2 = qs.filter(book__pubdate__lt='2011-01-01') |
| 1033 | self.assertEquals(qs[0].pages_written, qs2[0].pages_written) |
| 1034 | |
1023 | 1035 | def test_annotate_joins(self): |
1024 | 1036 | """ |
1025 | 1037 | Test that the base table's join isn't promoted to LOUTER. This could |