Merge remote branch 'meshy/new-test-versions'

This commit is contained in:
Diederik van der Boor
2017-04-06 13:57:07 +02:00
4 changed files with 24 additions and 2 deletions
+1 -1
View File
@@ -204,7 +204,7 @@ class MROBase2(MROBase1):
class MROBase3(models.Model):
id2 = models.AutoField(primary_key=True) # make sure 'id' field doesn't clash, detected by Django 1.11
base_3_id = models.AutoField(primary_key=True) # make sure 'id' field doesn't clash, detected by Django 1.11
objects = PolymorphicManager()
+5 -1
View File
@@ -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()), '<QuerySet [<ModelShow1_plain: ModelShow1_plain object>, <ModelShow2_plain: ModelShow2_plain object>]>')
# 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>]>')
def test_extra_method(self):
self.create_model2abcd()