mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #26373 -- Fixed reverse lookup crash with a ForeignKey to_field in a subquery.
This commit is contained in:
parent
8b5a4fa941
commit
4c1c93032f
3 changed files with 9 additions and 1 deletions
|
@ -2427,6 +2427,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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue