summaryrefslogtreecommitdiff
path: root/tests/cache
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cache')
-rw-r--r--tests/cache/tests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index ffbed67197..9d29239cf6 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -943,6 +943,17 @@ class DBCacheTests(BaseCacheTests, TransactionTestCase):
self.assertEqual(out.getvalue(),
"Cache table 'test cache table' already exists.\n" * len(settings.CACHES))
+ @override_settings(CACHES=caches_setting_for_tests(
+ BACKEND='django.core.cache.backends.db.DatabaseCache',
+ # Use another table name to avoid the 'table already exists' message.
+ LOCATION='createcachetable_dry_run_mode'
+ ))
+ def test_createcachetable_dry_run_mode(self):
+ out = six.StringIO()
+ management.call_command('createcachetable', dry_run=True, stdout=out)
+ output = out.getvalue()
+ self.assertTrue(output.startswith("CREATE TABLE"))
+
def test_createcachetable_with_table_argument(self):
"""
Delete and recreate cache table with legacy behavior (explicitly