- self.assertEqual(sorted(r.title.history.values()), ['t1', 't2'])
- self.assertEqual(sorted(r.description.history.values()), ['d1', 'd2'])
- self.assertEqual(sorted(r.effort.history.values()), [0.5, 1.5])
- self.assertEqual(sorted(r.conditions), sorted([c1, c2]))
- self.assertEqual(sorted(r.enables), sorted([c2, c3]))
- self.assertEqual(sorted(r.disables), sorted([c1, c3]))
+ self.assertEqual(sorted(r.conditions), sorted(set1))
+ self.assertEqual(sorted(r.enables), sorted(set2))
+ self.assertEqual(sorted(r.disables), sorted(set3))
+
+ def test_Process_from_table_row(self) -> None:
+ """Test .from_table_row() properly reads in class from DB"""
+ self.check_from_table_row()
+ self.check_versioned_from_table_row('title', str)
+ self.check_versioned_from_table_row('description', str)
+ self.check_versioned_from_table_row('effort', float)
+ p, set1, set2, set3 = self.p_of_conditions()
+ p.save(self.db_conn)
+ assert isinstance(p.id_, int)
+ for row in self.db_conn.row_where(self.checked_class.table_name,
+ 'id', p.id_):
+ # pylint: disable=no-member
+ r = Process.from_table_row(self.db_conn, row)
+ self.assertEqual(sorted(r.conditions), sorted(set1))
+ self.assertEqual(sorted(r.enables), sorted(set2))
+ self.assertEqual(sorted(r.disables), sorted(set3))