diff --git a/tests/annotations/tests.py b/tests/annotations/tests.py
index 4fc7e6f047..71d1822549 100644
a
|
b
|
class NonAggregateAnnotationTestCase(TestCase):
|
569 | 569 | Book.objects.annotate(is_book=True) |
570 | 570 | with self.assertRaisesMessage(TypeError, msg % ', '.join([str(BooleanField()), 'True'])): |
571 | 571 | Book.objects.annotate(BooleanField(), Value(False), is_book=True) |
| 572 | |
| 573 | def test_multiple_annotation_with_m2m(self): |
| 574 | qs = Author.objects.filter( |
| 575 | friends__age=35, |
| 576 | ).annotate( |
| 577 | jacob_name=F('friends__name'), |
| 578 | ).filter( |
| 579 | friends__age=29, |
| 580 | ).annotate( |
| 581 | james_name=F('friends__name'), |
| 582 | ).values('jacob_name', 'james_name') |
| 583 | self.assertCountEqual( |
| 584 | qs, |
| 585 | [{'jacob_name': 'Jacob Kaplan-Moss', 'james_name': 'James Bennett'}], |
| 586 | ) |