+ def test_Condition_removal(self) -> None:
+ """Test removal of Condition."""
+ cond = Condition(None, False)
+ cond.save(self.db_conn)
+ assert isinstance(cond.id_, int)
+ proc = Process(None)
+ proc.save(self.db_conn)
+ proc.set_conditions(self.db_conn, [cond.id_], 'conditions')
+ proc.save(self.db_conn)
+ with self.assertRaises(HandledException):
+ cond.remove(self.db_conn)
+ proc.set_conditions(self.db_conn, [], 'conditions')
+ proc.save(self.db_conn)
+ cond.remove(self.db_conn)
+ self.assertEqual(Condition.all(self.db_conn), [])
+