def __set__(self, instance, value): if write_through(instance): self.___set_value(instance, value) else: values = self.__values_of(instance) values[self.__propname] = value
def __set__(self, instance, value): if write_through(instance): self.___set_value(instance, value) else: values = self._values_of(instance) values[self.__propname] = value
def test_write_through_default(): obj = object() assert utils.write_through(obj) is False
def test_write_through(): obj = Mock() obj._meta.write_through = 'foo' assert utils.write_through(obj) == 'foo'