From 4e8c26531925227872ce29bc0cdee3329be4a216 Mon Sep 17 00:00:00 2001 From: Jason Parrott Date: Thu, 17 Mar 2016 22:45:00 +0900 Subject: [1.9.x] Fixed #26373 -- Fixed reverse lookup crash with a ForeignKey to_field in a subquery. Backport of 4c1c93032f4a015cbb4b33958603d18ac43515b4 from master --- tests/queries/tests.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/queries/tests.py b/tests/queries/tests.py index 7c306c9f15..05564a5909 100644 --- a/tests/queries/tests.py +++ b/tests/queries/tests.py @@ -2474,6 +2474,10 @@ class ToFieldTests(TestCase): set(Eaten.objects.filter(food__in=Food.objects.filter(name='apple').values('eaten__meal'))), set() ) + self.assertEqual( + set(Food.objects.filter(eaten__in=Eaten.objects.filter(meal='lunch'))), + {apple} + ) def test_reverse_in(self): apple = Food.objects.create(name="apple") -- cgit v1.3