See #2140. You can now bulk unassign aggregates, and they are auto directly contained in any previous indirect containers.

This commit is contained in:
Dion Moult
2023-03-11 16:31:09 +11:00
parent c51aa910cb
commit 0dad93bf00
10 changed files with 73 additions and 46 deletions
+6 -4
View File
@@ -50,9 +50,11 @@ class TestAssignObject:
class TestUnassignObject:
def test_run(self, ifc, collector):
ifc.get_entity("related_obj").should_be_called().will_return("related_object")
ifc.run("aggregate.unassign_object", product="related_object").should_be_called().will_return("rel")
def test_run(self, ifc, aggregate, collector):
ifc.get_entity("related_obj").should_be_called().will_return("element")
aggregate.get_container("element").should_be_called().will_return("container")
ifc.run("spatial.assign_container", product="element", relating_structure="container").should_be_called()
ifc.run("aggregate.unassign_object", product="element").should_be_called().will_return("rel")
collector.assign("relating_obj").should_be_called()
collector.assign("related_obj").should_be_called()
assert subject.unassign_object(ifc, collector, relating_obj="relating_obj", related_obj="related_obj") == "rel"
subject.unassign_object(ifc, aggregate, collector, relating_obj="relating_obj", related_obj="related_obj")