File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ def _rollback(self):
189
189
pass
190
190
191
191
def set_autocommit (self , autocommit , force_begin_transaction_with_broken_autocommit = False ):
192
- pass
192
+ self . autocommit = autocommit
193
193
194
194
@async_unsafe
195
195
def close (self ):
Original file line number Diff line number Diff line change 1
1
from django .core .exceptions import ImproperlyConfigured
2
2
from django .db import connection
3
- from django .test import SimpleTestCase
3
+ from django .test import SimpleTestCase , TestCase
4
4
5
5
from django_mongodb_backend .base import DatabaseWrapper
6
6
@@ -12,3 +12,12 @@ def test_database_name_empty(self):
12
12
msg = 'settings.DATABASES is missing the "NAME" value.'
13
13
with self .assertRaisesMessage (ImproperlyConfigured , msg ):
14
14
DatabaseWrapper (settings ).get_connection_params ()
15
+
16
+
17
+ class DatabaseWrapperConnectionTests (TestCase ):
18
+ def test_set_autocommit (self ):
19
+ self .assertIs (connection .get_autocommit (), True )
20
+ connection .set_autocommit (False )
21
+ self .assertIs (connection .get_autocommit (), False )
22
+ connection .set_autocommit (True )
23
+ self .assertIs (connection .get_autocommit (), True )
You can’t perform that action at this time.
0 commit comments