Esempio n. 1
0
def test_JSONEncodedDict(db):
    l = Language(id='abc', name='Name', jsondata={'i': 2})
    DBSession.add(l)
    DBSession.flush()

    DBSession.expunge(l)
    for lang in DBSession.query(Language).filter(Language.id == 'abc'):
        assert lang.jsondata['i'] == 2
        break
Esempio n. 2
0
def test_JSONEncodedDict(db):
    l = Language(id='abc', name='Name', jsondata={'i': 2})
    DBSession.add(l)
    DBSession.flush()

    DBSession.expunge(l)
    for lang in DBSession.query(Language).filter(Language.id == 'abc'):
        assert lang.jsondata['i'] == 2
        break
Esempio n. 3
0
def test_Base(db):
    l = Language(id='abc', name='Name')
    DBSession.add(l)
    DBSession.flush()
    DBSession.expunge(l)
    l = Language.get('abc', session=DBSession)
    assert l.name == 'Name'

    Language().__str__()
    assert repr(l) == "<Language 'abc'>"