def test_save(self, db: SQLAlchemyUnchained):
    (Foo, session_manager) = setup(db)
    foo = Foo(name='foo')
    session_manager.save(foo)
    assert (foo in db.session)
    with db.session.no_autoflush:
        assert (Foo.q.get_by(name='foo') is None)
    session_manager.save(foo, commit=True)
    assert (Foo.q.get_by(name='foo') == foo)
def test_save(self, db: SQLAlchemyUnchained):
    (Foo, session_manager) = setup(db)
    foo = Foo(name='foo')
    session_manager.save(foo)
    assert (foo in db.session)
    with db.session.no_autoflush:
        assert (Foo.q.get_by(name='foo') is None)
    session_manager.save(foo, commit=True)
    assert (Foo.q.get_by(name='foo') == foo)