tests for abstract/swappable model initialization
(cherry picked from commit 0fea8a4d92)
fix_request_path_info
parent
9c420c4c24
commit
6013de93d3
|
|
@ -400,6 +400,23 @@ class DateModel(PolymorphicModel):
|
||||||
date = models.DateTimeField()
|
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
|
# Import tests
|
||||||
from .test_admin import *
|
from .test_admin import *
|
||||||
from .test_orm import *
|
from .test_orm import *
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,8 @@ if not settings.configured:
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
|
POLYMORPHIC_TEST_SWAPPABLE='polymorphic.swappedmodel',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue