From: Mike Bayer Date: Sat, 5 May 2012 03:18:52 +0000 (-0400) Subject: a fix to allow mysql to work X-Git-Tag: rel_0_7_7~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89ad50aa7b3082a6ab299fbe9b6af22082c67acf;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git a fix to allow mysql to work --- diff --git a/test/orm/test_unitofworkv2.py b/test/orm/test_unitofworkv2.py index cfd36e696d..30557edefa 100644 --- a/test/orm/test_unitofworkv2.py +++ b/test/orm/test_unitofworkv2.py @@ -1,5 +1,5 @@ from test.lib.testing import eq_, assert_raises, assert_raises_message -from test.lib import testing +from test.lib import testing, engines from test.lib.schema import Table, Column from test.orm import _fixtures from test.lib import fixtures @@ -623,6 +623,16 @@ class RudimentaryFlushTest(UOWTest): class SingleCycleTest(UOWTest): + def teardown(self): + engines.testing_reaper.rollback_all() + # mysql can't handle delete from nodes + # since it doesn't deal with the FKs correctly, + # so wipe out the parent_id first + testing.db.execute( + self.tables.nodes.update().values(parent_id=None) + ) + super(SingleCycleTest, self).teardown() + def test_one_to_many_save(self): Node, nodes = self.classes.Node, self.tables.nodes @@ -936,6 +946,7 @@ class SingleCycleTest(UOWTest): n1.children self._assert_uow_size(sess, 2) + def test_delete_unloaded_m2o(self): Node, nodes = self.classes.Node, self.tables.nodes