summaryrefslogtreecommitdiff
path: root/tests/user_commands
diff options
context:
space:
mode:
authorBaptiste Mispelon <bmispelon@gmail.com>2014-08-19 16:56:01 +0200
committerBaptiste Mispelon <bmispelon@gmail.com>2014-08-19 18:00:39 +0200
commit24d9aee1880ced5892af42f35539a5d705adf512 (patch)
tree3b2bfee34a391167598c60f10dfd27b3a0167f7a /tests/user_commands
parentb3f6a0f5a1b88a9a96080531b7391f6a3a0ce5aa (diff)
[1.7.x] Fixed broken tests on Oracle after 5853c87a458f62ebd62d7809168355610de2570c.
Oracle doesn't have a `BEGIN` statement so the test would fail. Refs #23303 Backport of 54164b814cab71a8a0503743befbdcc99ae6c7a0 from master.
Diffstat (limited to 'tests/user_commands')
-rw-r--r--tests/user_commands/tests.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/user_commands/tests.py b/tests/user_commands/tests.py
index 1d405bec1c..ee746f7b52 100644
--- a/tests/user_commands/tests.py
+++ b/tests/user_commands/tests.py
@@ -1,6 +1,7 @@
import os
import sys
+from django.db import connection
from django.core import management
from django.core.management import CommandError
from django.core.management.utils import find_command, popen_wrapper
@@ -77,7 +78,9 @@ class CommandTests(SimpleTestCase):
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')
+ output = out.getvalue().strip()
+ self.assertTrue(output.startswith(connection.ops.start_transaction_sql()))
+ self.assertTrue(output.endswith(connection.ops.end_transaction_sql()))
class UtilsTests(SimpleTestCase):