Deletes config cache after each test if it exists.

This commit is contained in:
Norman Jäckel 2013-08-19 12:41:29 +02:00
parent 25bac4a704
commit c88d180808
2 changed files with 11 additions and 3 deletions

View File

@ -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