1
0
mirror of https://github.com/django/django.git synced 2025-10-25 06:36:07 +00:00

Fixed #27683 -- Made MySQL default to the read committed isolation level.

Thanks Shai Berger for test help and Adam Johnson for review.
This commit is contained in:
Tim Graham
2017-02-01 15:34:17 -05:00
committed by GitHub
parent c4e18bb1ce
commit 924af638e4
5 changed files with 40 additions and 13 deletions

View File

@@ -70,6 +70,15 @@ class MySQLTests(TestCase):
self.isolation_values[self.other_isolation_level]
)
def test_default_isolation_level(self):
# If not specified in settings, the default is read committed.
with get_connection() as new_connection:
new_connection.settings_dict['OPTIONS'].pop('isolation_level', None)
self.assertEqual(
self.get_isolation_level(new_connection),
self.isolation_values[self.read_committed]
)
def test_isolation_level_validation(self):
new_connection = connection.copy()
new_connection.settings_dict['OPTIONS']['isolation_level'] = 'xxx'