def test_delete(self, db: SQLAlchemyUnchained):
    (Foo, session_manager) = setup(db)
    foo1 = Foo(name='one')
    foo2 = Foo(name='two')
    all_ = [foo1, foo2]
    session_manager.save_all(all_, commit=True)
    for foo in all_:
        assert (foo in db.session)
        assert (Foo.q.get_by(name=foo.name) == foo)
    session_manager.delete(foo1, commit=True)
    assert (foo1 not in db.session)
    assert (Foo.q.get_by(name='one') is None)
    assert (foo2 in db.session)
    assert (Foo.q.get_by(name='two') == foo2)
def test_delete(self, db: SQLAlchemyUnchained):
    (Foo, session_manager) = setup(db)
    foo1 = Foo(name='one')
    foo2 = Foo(name='two')
    all_ = [foo1, foo2]
    session_manager.save_all(all_, commit=True)
    for foo in all_:
        assert (foo in db.session)
        assert (Foo.q.get_by(name=foo.name) == foo)
    session_manager.delete(foo1, commit=True)
    assert (foo1 not in db.session)
    assert (Foo.q.get_by(name='one') is None)
    assert (foo2 in db.session)
    assert (Foo.q.get_by(name='two') == foo2)