class TestResource(EntityModel): # pragma: no cover """ Stands for a test case """ __tablename__ = __alias__ = __namespace__ = 'metadash-test-resource' attr_1 = db.Column(db.String(), nullable=False) attr_2 = db.Column(db.String()) attr_3 = db.Column(db.DateTime()) def as_dict(self, **kwargs): ret = super(TestResource, self).as_dict(**kwargs) return ret
class Entity(EntityModel): """ Stands for a test case """ __tablename__ = __alias__ = __namespace__ = 'metadash-test-entity' value = db.Column(db.String()) def __init__(self, value): self.value = value
class Entity(EntityModel): # pragma: no cover """ Stands for a test case """ __tablename__ = __alias__ = __namespace__ = 'metadash-cache-test' value = db.Column(db.String()) @cache_on_entity_model() def test_cached_model_fn(self, dummy_value=None): return str(uuid.uuid1()) @cache_on_entity() def test_cached_fn(self, dummy_value=None): return str(uuid.uuid1()) @cached_entity_property() def test_cached_prop(self): return str(uuid.uuid1()) def __init__(self, value): self.value = value
class ConfigItem(db.Model): key = db.Column(db.Text(), primary_key=True, nullable=False) value = db.Column(db.Text())