Ticket #11505: patch.diff
File patch.diff, 1.9 KB (added by , 15 years ago) |
---|
-
django/test/testcases.py
214 214 ROOT_URLCONF with it. 215 215 * Clearing the mail test outbox. 216 216 """ 217 self._flush_cache() 217 218 self._fixture_setup() 218 219 self._urlconf_setup() 219 220 mail.outbox = [] 221 222 def _flush_cache(self): 223 from django.core.cache import cache 224 cache.flush() 220 225 221 226 def _fixture_setup(self): 222 227 call_command('flush', verbosity=0, interactive=False) -
tests/regressiontests/testcase/__init__.py
1 -
tests/regressiontests/testcase/tests.py
1 from django.test import TestCase 2 3 class TestCacheFlushed(TestCase): 4 # The cache should be flushed in between test cases 5 # Test that the cache setting in one test is not 6 # affecting the other 7 8 def setUp(self): 9 self.key = 'hello' 10 from django.core.cache import cache 11 self.cache = cache 12 13 def test_a(self): 14 self.assertEqual(self.cache.get(self.key), None) 15 self.cache.set(self.key, 'world') 16 17 def test_b(self): 18 self.assertEqual(self.cache.get(self.key), None) 19 self.cache.set(self.key, 'world') 20 -
tests/regressiontests/testcase/models.py
1