summaryrefslogtreecommitdiff
path: root/tests/generic_relations_regress/tests.py
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2018-08-08 22:25:18 -0300
committerTim Graham <timograham@gmail.com>2018-08-10 12:17:26 -0400
commitb5c7cb4d3306a7b4e8f87bcf365ff30ae53018ed (patch)
tree2c58f65b31b02ebb5d3d3402404e3ba7d6202600 /tests/generic_relations_regress/tests.py
parent64e1a271f50d921a54388539b6ff7102a31c3d29 (diff)
Fixed #29653 -- Fixed missing related_query_name reverse accessor if GenericRelation is declared on an abstract base model.
Regression in 4ab027b94409e6415b774797bf9d3593da9d9ea8. Thanks Lauri Kainulainen for the report.
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])