-
- def versioned_condition(self) -> Condition:
- """Create Condition with some VersionedAttribute values."""
- c = Condition(None)
- c.title.set('title1')
- c.title.set('title2')
- c.description.set('desc1')
- c.description.set('desc2')
- return c
-
- def test_Condition_saving_and_caching(self) -> None:
- """Test .save/.save_core."""
- kwargs = {'id_': 1, 'is_active': False}
- self.check_saving_and_caching(**kwargs)
- # check .id_ set if None, and versioned attributes too
- c = self.versioned_condition()
- c.save(self.db_conn)
- self.assertEqual(c.id_, 2)
- self.assertEqual(sorted(c.title.history.values()),
- ['title1', 'title2'])
- self.assertEqual(sorted(c.description.history.values()),
- ['desc1', 'desc2'])
+ default_init_kwargs = {'is_active': False}
+ test_versioneds = {'title': str, 'description': str}