+ def test_ProcessStep_singularity(self) -> None:
+ """Test pointers made for single object keep pointing to it."""
+ p_1 = Process(None)
+ p_1.save_without_steps(self.db_conn)
+ p_2 = Process(None)
+ p_2.save_without_steps(self.db_conn)
+ assert p_2.id_ is not None
+ step = p_1.add_step(self.db_conn, None, p_2.id_, None)
+ assert step.id_ is not None
+ step_retrieved = ProcessStep.by_id(self.db_conn, step.id_)
+ step.parent_step_id = 99
+ self.assertEqual(step.parent_step_id, step_retrieved.parent_step_id)
+
+ def test_Process_singularity(self) -> None:
+ """Test pointers made for single object keep pointing to it."""
+ p_1 = Process(None)
+ p_1.save_without_steps(self.db_conn)
+ p_2 = Process(None)
+ p_2.save_without_steps(self.db_conn)
+ assert p_2.id_ is not None
+ p_1.add_step(self.db_conn, None, p_2.id_, None)
+ p_retrieved = Process.by_id(self.db_conn, p_1.id_)
+ self.assertEqual(p_1.explicit_steps, p_retrieved.explicit_steps)
+
+ def test_Process_versioned_attributes_singularity(self) -> None:
+ """Test behavior of VersionedAttributes on saving (with .title)."""
+ p = Process(None)
+ p.save_without_steps(self.db_conn)
+ p.title.set('named')
+ p_loaded = Process.by_id(self.db_conn, p.id_)
+ self.assertEqual(p.title.history, p_loaded.title.history)
+