Fixed #26009 -- Fixed contenttypes_tests isolation.

This commit is contained in:
Tim Graham 2016-01-02 06:00:25 -05:00
parent b07f91600d
commit 2c6c873e3f
4 changed files with 95 additions and 102 deletions

View file

@ -1,9 +1,5 @@
"""
Tests for the order_with_respect_to Meta attribute.
We explicitly declare app_label on these models, because they are reused by
contenttypes_tests. When those tests are run in isolation, these models need
app_label because order_with_respect_to isn't in INSTALLED_APPS.
"""
from django.db import models
@ -14,9 +10,6 @@ from django.utils.encoding import python_2_unicode_compatible
class Question(models.Model):
text = models.CharField(max_length=200)
class Meta:
app_label = 'order_with_respect_to'
@python_2_unicode_compatible
class Answer(models.Model):
@ -25,7 +18,6 @@ class Answer(models.Model):
class Meta:
order_with_respect_to = 'question'
app_label = 'order_with_respect_to'
def __str__(self):
return six.text_type(self.text)
@ -38,7 +30,6 @@ class Post(models.Model):
class Meta:
order_with_respect_to = "parent"
app_label = 'order_with_respect_to'
def __str__(self):
return self.title