Changes between Initial Version and Version 1 of Ticket #33598, comment 2


Ignore:
Timestamp:
Mar 24, 2022, 1:57:48 AM (2 years ago)
Author:
Mariusz Felisiak

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33598, comment 2

    initial v1  
    1 Thanks for the report!
     1Thanks for the report! A regression test:
     2{{{#!diff
     3diff --git a/tests/filtered_relation/tests.py b/tests/filtered_relation/tests.py
     4index 790a90d9e2..1208ddde5f 100644
     5--- a/tests/filtered_relation/tests.py
     6+++ b/tests/filtered_relation/tests.py
     7@@ -211,6 +211,33 @@ class FilteredRelationTests(TestCase):
     8             str(queryset.query),
     9         )
     10 
     11+    def test_multiple(self):
     12+        qs = (
     13+            Author.objects.annotate(
     14+                book_title_alice=FilteredRelation(
     15+                    "book", condition=Q(book__title__contains="Alice")
     16+                ),
     17+                book_title_jane=FilteredRelation(
     18+                    "book", condition=Q(book__title__icontains="Jane")
     19+                ),
     20+            )
     21+            .filter(name="Jane")
     22+            .values("book_title_alice__title", "book_title_jane__title")
     23+        )
     24+        self.assertSequenceEqual(
     25+            qs,
     26+            [
     27+                {
     28+                    "book_title_alice__title": None,
     29+                    "book_title_jane__title": "The book by Jane A",
     30+                },
     31+                {
     32+                    "book_title_alice__title": None,
     33+                    "book_title_jane__title": "The book by Jane B",
     34+                },
     35+            ],
     36+        )
     37+
     38     def test_with_multiple_filter(self):
     39         self.assertSequenceEqual(
     40             Author.objects.annotate(
     41}}}
    242
    343Regression in 0c71e0f9cfa714a22297ad31dd5613ee548db379
Back to Top