@@ -0,0 +1,1358 @@
+import aiopg.sa%0Aimport pytest%0Aimport sqlalchemy as sa%0A%0Afrom dvhb_hybrid.amodels import Model%0A%0A%0A@pytest.fixture%0Adef db_factory(loop):%0A    return aiopg.sa.create_engine(%0A        database='test_dvhb_hybrid', loop=loop%0A    )%0A%0A%0Aclass Model1(Model):%0A    table = sa.table(%0A        'test',%0A        sa.column('id', sa.Integer),%0A        sa.column('text', sa.Text),%0A    )%0A%0A%0Aasync def test_create(db_factory):%0A    app = %7B%7D%0A    model = Model1.factory(app)%0A    async with db_factory as db:%0A        app%5B'db'%5D = db%0A        obj = await model.create(text='123')%0A    assert isinstance(obj.pk, int)%0A%0A%0Aasync def test_get_one(db_factory):%0A    app = %7B%7D%0A    model = Model1.factory(app)%0A    async with db_factory as db:%0A        app%5B'db'%5D = db%0A        obj = await model.create(text='123')%0A        obj2 = await model.get_one(obj.pk, fields=%5B'id', 'text'%5D)%0A    assert obj.pk == obj2.pk%0A%0A%0Aasync def test_get_or_create(db_factory):%0A    app = %7B%7D%0A    model = Model1.factory(app)%0A    async with db_factory as db:%0A        app%5B'db'%5D = db%0A        obj, created = await model.get_or_create(model.table.c.text=='123')%0A    assert isinstance(created, bool)%0A%0A%0Aasync def test_list(db_factory):%0A    app = %7B%7D%0A    model = Model1.factory(app)%0A    async with db_factory as db:%0A        app%5B'db'%5D = db%0A        l = await model.get_list(limit=1, offset=1, fields=%5B'id', 'text'%5D)%0A    assert isinstance(l, list)%0A

test for amodel