class BaseStatistic(model.Model): """Base Statistic Model class. Attributes: bytes (int): the total number of bytes taken up in Cloud Datastore for the statistic instance. count (int): attribute is the total number of occurrences of the statistic in Cloud Datastore. timestamp (datetime.datetime): the time the statistic instance was written to Cloud Datastore. """ # This is necessary for the _get_kind() classmethod override. STORED_KIND_NAME = "__BaseStatistic__" bytes = model.IntegerProperty() count = model.IntegerProperty() timestamp = model.DateTimeProperty() @classmethod def _get_kind(cls): """Kind name override.""" return cls.STORED_KIND_NAME
class SomeKind(model.Model): prop1 = model.DateTimeProperty()
def test_constructor(): with pytest.raises(NotImplementedError): model.DateTimeProperty()