]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- this assertion moves out to configure_mappers() now
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Mar 2013 00:22:43 +0000 (19:22 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Mar 2013 00:22:43 +0000 (19:22 -0500)
test/orm/test_unitofwork.py

index 7fc728f1dee48c9c0081defa029f8d9e581e82a0..6be1672e16b6cc91c7d96bd1e56daaa207476481 100644 (file)
@@ -616,19 +616,25 @@ class ExtraPassiveDeletesTest(fixtures.MappedTest):
 
     def test_assertions(self):
         myothertable, MyOtherClass = self.tables.myothertable, self.classes.MyOtherClass
+        mytable, MyClass = self.tables.mytable, self.classes.MyClass
 
+        mapper(MyClass, mytable, properties={
+            'foo': relationship(MyOtherClass,
+                                    passive_deletes='all',
+                                    cascade="all")
+            })
         mapper(MyOtherClass, myothertable)
+
         assert_raises_message(
             sa.exc.ArgumentError,
-            "Can't set passive_deletes='all' in conjunction with 'delete' "
+            "On MyClass.foo, can't set passive_deletes='all' in conjunction with 'delete' "
             "or 'delete-orphan' cascade",
-            relationship, MyOtherClass,
-                                    passive_deletes='all',
-                                    cascade="all"
+            sa.orm.configure_mappers
         )
 
     def test_extra_passive(self):
-        myothertable, MyClass, MyOtherClass, mytable = (self.tables.myothertable,
+        myothertable, MyClass, MyOtherClass, mytable = (
+                                self.tables.myothertable,
                                 self.classes.MyClass,
                                 self.classes.MyOtherClass,
                                 self.tables.mytable)