コード例 #1
0
ファイル: test_sqlalchemy.py プロジェクト: timbu/taal
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
コード例 #2
0
ファイル: test_sqlalchemy.py プロジェクト: onefinestay/taal
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
コード例 #3
0
ファイル: test_sqlalchemy.py プロジェクト: timbu/taal
def test_load_error():
    instance = Model()
    instance.__dict__['name'] = 'foo'
    with pytest.raises(TypeError):
        load(instance, None)
コード例 #4
0
ファイル: test_sqlalchemy.py プロジェクト: onefinestay/taal
def test_load_error():
    instance = Model()
    instance.__dict__['name'] = 'foo'
    with pytest.raises(TypeError):
        load(instance, None)