mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #21703 -- Fixed a crash when excluding a related field with a F().
This commit is contained in:
committed by
Tim Graham
parent
cbf7e71558
commit
f19a4945e1
@@ -2776,6 +2776,12 @@ class ExcludeTests(TestCase):
|
||||
employment__title__in=('Engineer', 'Developer')).distinct().order_by('name')
|
||||
self.assertSequenceEqual(alex_nontech_employers, [google, intel, microsoft])
|
||||
|
||||
def test_exclude_reverse_fk_field_ref(self):
|
||||
tag = Tag.objects.create()
|
||||
Note.objects.create(tag=tag, note='note')
|
||||
annotation = Annotation.objects.create(name='annotation', tag=tag)
|
||||
self.assertEqual(Annotation.objects.exclude(tag__note__note=F('name')).get(), annotation)
|
||||
|
||||
|
||||
class ExcludeTest17600(TestCase):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user