mirror of
https://github.com/django/django.git
synced 2025-11-03 05:13:23 +00:00
Removed some direct settings manipulations in tests; refs #21230.
This commit is contained in:
parent
499cd912ca
commit
3565efaa45
16 changed files with 137 additions and 223 deletions
|
|
@ -150,6 +150,7 @@ class ProxyModelTests(TestCase):
|
|||
proxy = True
|
||||
self.assertRaises(FieldError, build_new_fields)
|
||||
|
||||
@override_settings(TEST_SWAPPABLE_MODEL='proxy_models.AlternateModel')
|
||||
def test_swappable(self):
|
||||
try:
|
||||
# This test adds dummy applications to the app cache. These
|
||||
|
|
@ -158,8 +159,6 @@ class ProxyModelTests(TestCase):
|
|||
old_app_models = copy.deepcopy(cache.app_models)
|
||||
old_app_store = copy.deepcopy(cache.app_store)
|
||||
|
||||
settings.TEST_SWAPPABLE_MODEL = 'proxy_models.AlternateModel'
|
||||
|
||||
class SwappableModel(models.Model):
|
||||
|
||||
class Meta:
|
||||
|
|
@ -175,7 +174,6 @@ class ProxyModelTests(TestCase):
|
|||
class Meta:
|
||||
proxy = True
|
||||
finally:
|
||||
del settings.TEST_SWAPPABLE_MODEL
|
||||
cache.app_models = old_app_models
|
||||
cache.app_store = old_app_store
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue