Changeset 771 in main
- Timestamp:
- 02/17/12 12:59:32 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/openPLM/plmapp/tests/controllers/part.py
r769 r771 162 162 self.assertFalse(self.controller.get_children()) 163 163 164 def test_add_child_error_deprecated_child(self): 165 """ 166 Tests that it is not possible to add a deprecated child. 167 """ 168 self.controller2.promote() 169 self.controller2.promote() 170 def fail(): 171 self.add_child() 172 self.assertRaises(ValueError, fail) 173 self.assertFalse(self.controller.get_children()) 174 175 def test_add_child_error_cancelled_child(self): 176 """ 177 Tests that it is not possible to add a cancelled child. 178 """ 179 self.controller.cancel() 180 def fail(): 181 self.add_child() 182 self.assertRaises(exc.PermissionError, fail) 183 self.assertFalse(self.controller.get_children()) 184 185 def test_add_child_error_cancelled(self): 186 """ 187 Tests that it is not possible to add a child to a cancelled object. 188 """ 189 self.controller.cancel() 190 ctrl = self.CONTROLLER(self.controller.object, self.controller.owner) 191 def fail(): 192 ctrl.add_child(self.controller2.object, 10, 15, "m") 193 self.assertRaises(exc.PermissionError, fail) 194 self.assertFalse(self.controller.get_children()) 195 164 196 def _test_modify_child(self, new_qty, new_order, new_unit): 165 197 self.add_child()
Note: See TracChangeset
for help on using the changeset viewer.