mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
[1.7.x] Fixed broken tests on Oracle after 5853c87a45.
Oracle doesn't have a `BEGIN` statement so the test would
fail.
Refs #23303
Backport of 54164b814c from master.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user