- def check_storage(self, content: list[Condition]) -> None:
- """Test cache and DB equal content."""
- expected_cache = {}
- for item in content:
- expected_cache[item.id_] = item
- self.assertEqual(Condition.get_cache(), expected_cache)
- db_found: list[Condition] = []
- for item in content:
- assert isinstance(item.id_, int)
- for row in self.db_conn.row_where(Condition.table_name, 'id',
- item.id_):
- db_found += [Condition.from_table_row(self.db_conn, row)]
- self.assertEqual(sorted(content), sorted(db_found))
-
- def test_Condition_saving_and_caching(self) -> None:
- """Test .save/.save_core."""
- c = Condition(None, False)
+ def versioned_condition(self) -> Condition:
+ """Create Condition with some VersionedAttribute values."""
+ c = Condition(None)