From 9ab1d5559681d3adde4fcfc98a19a7396ed6a42e Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Thu, 28 Mar 2019 07:10:54 +0100 Subject: [PATCH] Refs #18726 -- Added test for excluding circular related fields with F() expression. Fixed in f19a4945e1191e1696f1ad8e6cdc6f939c702728. --- tests/queries/tests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/queries/tests.py b/tests/queries/tests.py index 373a0e224a2..2c404342e41 100644 --- a/tests/queries/tests.py +++ b/tests/queries/tests.py @@ -2782,6 +2782,9 @@ class ExcludeTests(TestCase): annotation = Annotation.objects.create(name='annotation', tag=tag) self.assertEqual(Annotation.objects.exclude(tag__note__note=F('name')).get(), annotation) + def test_exclude_with_circular_fk_relation(self): + self.assertEqual(ObjectB.objects.exclude(objecta__objectb__name=F('name')).count(), 0) + class ExcludeTest17600(TestCase): """