def test_load_translatable_string(bound_session): # can happen in session.merge instance = Model(name='name') bound_session.add(instance) attr_before = instance.name load(instance, None) assert instance.name == attr_before
def test_load_error(): instance = Model() instance.__dict__['name'] = 'foo' with pytest.raises(TypeError): load(instance, None)