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:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user