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