Django 1.11 uses real class names in __repr__()
See https://code.djangoproject.com/ticket/27546 and https://github.com/django/django/commit/48826aafix_request_path_info
parent
8e52bdf6d1
commit
aefb7dabc2
|
|
@ -360,6 +360,10 @@ class PolymorphicTests(TestCase):
|
||||||
# no pretty printing
|
# no pretty printing
|
||||||
ModelShow1_plain.objects.create(field1='abc')
|
ModelShow1_plain.objects.create(field1='abc')
|
||||||
ModelShow2_plain.objects.create(field1='abc', field2='def')
|
ModelShow2_plain.objects.create(field1='abc', field2='def')
|
||||||
|
# repr classnames are not hardcoded in Django 1.11+
|
||||||
|
if django.VERSION >= (1, 11):
|
||||||
|
self.assertEqual(qrepr(ModelShow1_plain.objects.all()), '<PolymorphicQuerySet [<ModelShow1_plain: ModelShow1_plain object>, <ModelShow2_plain: ModelShow2_plain object>]>')
|
||||||
|
else:
|
||||||
self.assertEqual(qrepr(ModelShow1_plain.objects.all()), '<QuerySet [<ModelShow1_plain: ModelShow1_plain object>, <ModelShow2_plain: ModelShow2_plain object>]>')
|
self.assertEqual(qrepr(ModelShow1_plain.objects.all()), '<QuerySet [<ModelShow1_plain: ModelShow1_plain object>, <ModelShow2_plain: ModelShow2_plain object>]>')
|
||||||
|
|
||||||
def test_extra_method(self):
|
def test_extra_method(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue