summaryrefslogtreecommitdiff
path: root/tests/generic_relations_regress/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/generic_relations_regress/tests.py')
-rw-r--r--tests/generic_relations_regress/tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/generic_relations_regress/tests.py b/tests/generic_relations_regress/tests.py
index 769a64d0f1..fc7447fa51 100644
--- a/tests/generic_relations_regress/tests.py
+++ b/tests/generic_relations_regress/tests.py
@@ -273,3 +273,12 @@ class GenericRelationTests(TestCase):
link = Link.objects.create(content_object=place)
result = Link.objects.filter(places=place)
self.assertCountEqual(result, [link])
+
+ def test_generic_reverse_relation_with_abc(self):
+ """
+ The reverse generic relation accessor (targets) is created if the
+ GenericRelation comes from an abstract base model (HasLinks).
+ """
+ thing = HasLinkThing.objects.create()
+ link = Link.objects.create(content_object=thing)
+ self.assertCountEqual(link.targets.all(), [thing])