예제 #1
0
 def __set__(self, instance, value):
     if write_through(instance):
         self.___set_value(instance, value)
     else:
         values = self.__values_of(instance)
         values[self.__propname] = value
예제 #2
0
 def __set__(self, instance, value):
     if write_through(instance):
         self.___set_value(instance, value)
     else:
         values = self._values_of(instance)
         values[self.__propname] = value
예제 #3
0
def test_write_through_default():
    obj = object()

    assert utils.write_through(obj) is False
예제 #4
0
def test_write_through():
    obj = Mock()
    obj._meta.write_through = 'foo'

    assert utils.write_through(obj) == 'foo'
예제 #5
0
def test_write_through_default():
    obj = object()

    assert utils.write_through(obj) is False
예제 #6
0
def test_write_through():
    obj = Mock()
    obj._meta.write_through = 'foo'

    assert utils.write_through(obj) == 'foo'