def test_state_crud(self):
        saved = ActionExecutionStateTests._create_save_actionstate()
        retrieved = ActionExecutionState.get_by_id(saved.id)
        self.assertDictEqual(saved.query_context, retrieved.query_context)
        self.assertEqual(saved.query_module, retrieved.query_module)
        ActionExecutionStateTests._delete(model_objects=[retrieved])
        try:
            retrieved = ActionExecutionState.get_by_id(saved.id)
        except __HOLE__:
            retrieved = None
        self.assertIsNone(retrieved, 'managed to retrieve after failure.')
dataset/ETHPy150Open StackStorm/st2/st2common/tests/unit/test_db_action_state.py/ActionExecutionStateTests.test_state_crud