Deletes config cache after each test if it exists.
This commit is contained in:
parent
25bac4a704
commit
c88d180808
@ -25,6 +25,14 @@ class TestCase(_TestCase):
|
||||
def _pre_setup(self, *args, **kwargs):
|
||||
return_value = super(TestCase, self)._pre_setup(*args, **kwargs)
|
||||
post_database_setup.send(sender=self)
|
||||
# Resetting the config object by deleting the cache
|
||||
del config._cache
|
||||
return return_value
|
||||
|
||||
def _post_teardown(self, *args, **kwargs):
|
||||
return_value = super(TestCase, self)._post_teardown(*args, **kwargs)
|
||||
# Resets the config object by deleting the cache
|
||||
try:
|
||||
del config._cache
|
||||
except AttributeError:
|
||||
# The cache has only to be deleted if it exists.
|
||||
pass
|
||||
return return_value
|
||||
|
Loading…
Reference in New Issue
Block a user