mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed #21703 -- Fixed a crash when excluding a related field with a F().
This commit is contained in:
parent
cbf7e71558
commit
f19a4945e1
2 changed files with 12 additions and 1 deletions
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue