Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix M2M interaction with transactions

  • Loading branch information...
commit 310cdf492d2642e7cf00bcc169895f5954f10369 1 parent b1e0ec0
Andrew Godwin authored July 02, 2013

Showing 1 changed file with 0 additions and 4 deletions. Show diff stats Hide diff stats

  1. 4  tests/schema/tests.py
4  tests/schema/tests.py
@@ -250,7 +250,6 @@ def test_m2m(self):
250 250
         try:
251 251
             # Ensure there's no m2m table there
252 252
             self.assertRaises(DatabaseError, self.column_classes, new_field.rel.through)
253  
-            connection.rollback()
254 253
             # Add the field
255 254
             with connection.schema_editor() as editor:
256 255
                 editor.add_field(
@@ -268,11 +267,9 @@ def test_m2m(self):
268 267
                 )
269 268
             # Ensure there's no m2m table there
270 269
             self.assertRaises(DatabaseError, self.column_classes, new_field.rel.through)
271  
-            connection.rollback()
272 270
         finally:
273 271
             # Cleanup model states
274 272
             AuthorWithM2M._meta.local_many_to_many.remove(new_field)
275  
-            del AuthorWithM2M._meta._m2m_cache
276 273
 
277 274
     def test_m2m_repoint(self):
278 275
         """
@@ -305,7 +302,6 @@ def test_m2m_repoint(self):
305 302
                 )
306 303
             # Ensure old M2M is gone
307 304
             self.assertRaises(DatabaseError, self.column_classes, BookWithM2M._meta.get_field_by_name("tags")[0].rel.through)
308  
-            connection.rollback()
309 305
             # Ensure the new M2M exists and points to UniqueTest
310 306
             constraints = connection.introspection.get_constraints(connection.cursor(), new_field.rel.through._meta.db_table)
311 307
             if connection.features.supports_foreign_keys:

0 notes on commit 310cdf4

Please sign in to comment.
Something went wrong with that request. Please try again.