Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
def test_load_error():
    instance = Model()
    instance.__dict__['name'] = 'foo'
    with pytest.raises(TypeError):
        load(instance, None)
Exemplo n.º 4
0
def test_load_error():
    instance = Model()
    instance.__dict__['name'] = 'foo'
    with pytest.raises(TypeError):
        load(instance, None)