diff options
-rw-r--r-- | test/orm/session.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/orm/session.py b/test/orm/session.py index 48b6a9c7d..aab50ac47 100644 --- a/test/orm/session.py +++ b/test/orm/session.py @@ -38,6 +38,22 @@ class SessionTest(AssertMixin): s.user_name = 'some other user' s.flush() + def test_transaction(self): + class User(object):pass + mapper(User, users) + sess = create_session() + transaction = sess.create_transaction() + try: + u = User() + sess.save(u) + sess.flush() + sess.delete(u) + sess.save(User()) + sess.flush() + transaction.commit() + except: + transaction.rollback() + def test_close_two(self): c = testbase.db.connect() try: |