summaryrefslogtreecommitdiff
path: root/tests/user_commands/tests.py
diff options
context:
space:
mode:
authorBaptiste Mispelon <bmispelon@gmail.com>2014-08-16 17:21:14 +0200
committerBaptiste Mispelon <bmispelon@gmail.com>2014-08-18 19:36:34 +0200
commit3a80189479a29220bac6d205a1b97184bd76a876 (patch)
tree308dac3d060cb4b1bbbe7b78fbd576273fbdd0ec /tests/user_commands/tests.py
parent126606c5b8499830cd56cbe632f6af17bc7471ea (diff)
[1.7.x] Fixed #23303 -- Added BEGIN and COMMIT statements to the output of sqlmigrate.
Backport of 5853c87a458f62ebd62d7809168355610de2570c from master. Conflicts: django/core/management/commands/sqlmigrate.py tests/user_commands/tests.py
Diffstat (limited to 'tests/user_commands/tests.py')
-rw-r--r--tests/user_commands/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/user_commands/tests.py b/tests/user_commands/tests.py
index c24a6e7a2d..1d405bec1c 100644
--- a/tests/user_commands/tests.py
+++ b/tests/user_commands/tests.py
@@ -74,6 +74,11 @@ class CommandTests(SimpleTestCase):
if current_path is not None:
os.environ['PATH'] = current_path
+ def test_output_transaction(self):
+ out = StringIO()
+ management.call_command('transaction', stdout=out, no_color=True)
+ self.assertEqual(out.getvalue(), 'BEGIN;\nHello!\n\nCOMMIT;\n')
+
class UtilsTests(SimpleTestCase):