From aefb7dabc2b0ba37da9b86f9c44823002e98efa5 Mon Sep 17 00:00:00 2001 From: Charlie Denton Date: Fri, 3 Mar 2017 22:36:31 +0000 Subject: [PATCH] Django 1.11 uses real class names in __repr__() See https://code.djangoproject.com/ticket/27546 and https://github.com/django/django/commit/48826aa --- polymorphic/tests/test_orm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/polymorphic/tests/test_orm.py b/polymorphic/tests/test_orm.py index 9498312..f284033 100644 --- a/polymorphic/tests/test_orm.py +++ b/polymorphic/tests/test_orm.py @@ -360,7 +360,11 @@ class PolymorphicTests(TestCase): # no pretty printing ModelShow1_plain.objects.create(field1='abc') ModelShow2_plain.objects.create(field1='abc', field2='def') - self.assertEqual(qrepr(ModelShow1_plain.objects.all()), ', ]>') + # repr classnames are not hardcoded in Django 1.11+ + if django.VERSION >= (1, 11): + self.assertEqual(qrepr(ModelShow1_plain.objects.all()), ', ]>') + else: + self.assertEqual(qrepr(ModelShow1_plain.objects.all()), ', ]>') def test_extra_method(self): self.create_model2abcd()