summaryrefslogtreecommitdiff
path: root/tests/cache
diff options
context:
space:
mode:
authorLoic Bistuer <loic.bistuer@gmail.com>2014-10-22 00:15:10 +0700
committerLoic Bistuer <loic.bistuer@gmail.com>2014-10-22 09:25:50 +0700
commit494ba051bb0d3ebbdbea7598251b1ee6fe9b69b4 (patch)
tree47c302bf0d5b9429efea854add58707ff0e54f25 /tests/cache
parent533532302ae842c95cf7294ef6cd7f3e2bfaca65 (diff)
Made testing of stdout and stderr more consistent.
Refs #23663.
Diffstat (limited to 'tests/cache')
-rw-r--r--tests/cache/tests.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index 6410e0b0be..ee003e9cac 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -912,12 +912,9 @@ class DBCacheTests(BaseCacheTests, TransactionTestCase):
self._perform_cull_test(caches['zero_cull'], 50, 18)
def test_second_call_doesnt_crash(self):
- stdout = six.StringIO()
- management.call_command(
- 'createcachetable',
- stdout=stdout
- )
- self.assertEqual(stdout.getvalue(),
+ out = six.StringIO()
+ management.call_command('createcachetable', stdout=out)
+ self.assertEqual(out.getvalue(),
"Cache table 'test cache table' already exists.\n" * len(settings.CACHES))
def test_createcachetable_with_table_argument(self):
@@ -926,14 +923,14 @@ class DBCacheTests(BaseCacheTests, TransactionTestCase):
specifying the table name).
"""
self.drop_table()
- stdout = six.StringIO()
+ out = six.StringIO()
management.call_command(
'createcachetable',
'test cache table',
verbosity=2,
- stdout=stdout
+ stdout=out,
)
- self.assertEqual(stdout.getvalue(),
+ self.assertEqual(out.getvalue(),
"Cache table 'test cache table' created.\n")
def test_clear_commits_transaction(self):