Removed very old warning that states that passive_deletes is not intended
for many-to-one relationships. While it is likely that in many cases
placing this parameter on a many-to-one relationship is not what was
intended, there are use cases where delete cascade may want to be
disallowed following from such a relationship.
Change-Id: I07adb726633f73f26296add4ec70376d5dcf8817
References: #5983
(cherry picked from commit
a63b23392fc31766e32b8650127d9006ee189a0f)
--- /dev/null
+.. change::
+ :tags: bug, orm
+ :tickets: 5983
+
+ Removed very old warning that states that passive_deletes is not intended
+ for many-to-one relationships. While it is likely that in many cases
+ placing this parameter on a many-to-one relationship is not what was
+ intended, there are use cases where delete cascade may want to be
+ disallowed following from such a relationship.
+
+
code="bbf0",
)
- if self.direction is MANYTOONE and self.passive_deletes:
- util.warn(
- "On %s, 'passive_deletes' is normally configured "
- "on one-to-many, one-to-one, many-to-many "
- "relationships only." % self
- )
-
if self.passive_deletes == "all" and (
"delete" in cascade or "delete-orphan" in cascade
):
eq_(select([func.count("*")]).select_from(mytable).scalar(), 1)
eq_(select([func.count("*")]).select_from(myothertable).scalar(), 0)
- def test_aaa_m2o_emits_warning(self):
+ def test_aaa_m2o_no_longer_emits_warning(self):
myothertable, MyClass, MyOtherClass, mytable = (
self.tables.myothertable,
self.classes.MyClass,
},
)
mapper(MyClass, mytable)
- assert_raises(sa.exc.SAWarning, sa.orm.configure_mappers)
+ sa.orm.configure_mappers()
class BatchDeleteIgnoresRowcountTest(fixtures.DeclarativeMappedTest):