Merge pull request #3171 from bradleymarques/fix-cache-not-clearing-with-evennia-test-case
Fix Django ID cache not being flushed in EvenniaTestCase
This commit is contained in:
commit
f3705248fc
2 changed files with 12 additions and 2 deletions
|
|
@ -106,7 +106,7 @@ To test this, run
|
||||||
|
|
||||||
to run the entire test module
|
to run the entire test module
|
||||||
|
|
||||||
evennia test --settings setings.py world.tests
|
evennia test --settings settings.py world.tests
|
||||||
|
|
||||||
or a specific class:
|
or a specific class:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -558,9 +558,19 @@ class EvenniaTestCase(TestCase):
|
||||||
"""
|
"""
|
||||||
For use with gamedir settings; Just like the normal test case, only for naming consistency.
|
For use with gamedir settings; Just like the normal test case, only for naming consistency.
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
- Inheriting from this class will bypass EvenniaTestMixin, and therefore
|
||||||
|
not setup some default objects. This can result in faster tests.
|
||||||
|
|
||||||
|
- If you do inherit from this class for your unit tests, and have
|
||||||
|
overridden the tearDown() method, please also call flush_cache(). Not
|
||||||
|
doing so will result in flakey and order-dependent tests due to the
|
||||||
|
Django ID cache not being flushed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
def tearDown(self) -> None:
|
||||||
|
flush_cache()
|
||||||
|
|
||||||
|
|
||||||
@override_settings(**DEFAULT_SETTINGS)
|
@override_settings(**DEFAULT_SETTINGS)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue