tests for abstract/swappable model initialization

This commit is contained in:
Tadas Dailyda
2017-07-25 14:02:15 +03:00
parent 342780300f
commit 0fea8a4d92
2 changed files with 19 additions and 1 deletions
+17
View File
@@ -400,6 +400,23 @@ class DateModel(PolymorphicModel):
date = models.DateTimeField()
# Define abstract and swappable (being swapped for SwappedModel) models
# To test manager validation (should be skipped for such models)
class AbstractModel(PolymorphicModel):
class Meta:
abstract = True
class SwappableModel(AbstractModel):
class Meta:
swappable = 'POLYMORPHIC_TEST_SWAPPABLE'
class SwappedModel(AbstractModel):
pass
# Import tests
from .test_admin import *
from .test_orm import *
+2 -1
View File
@@ -57,7 +57,8 @@ if not settings.configured:
),
},
},
]
],
POLYMORPHIC_TEST_SWAPPABLE='polymorphic.swappedmodel',
)