def test_delete_object_with_flush(self, db_session):
     user = User(user_name='some_new_user', email='foo')
     assert user.id is None
     user.persist(flush=True, db_session=db_session)
     assert user.id is not None
     uid = user.id
     User.by_id(uid, db_session=db_session) is not None
     user.delete()
     assert User.by_id(uid, db_session=db_session) is None
Example #2
0
 def test_delete_object_with_flush(self, db_session):
     user = User(user_name='some_new_user', email='foo')
     assert user.id is None
     user.persist(flush=True, db_session=db_session)
     assert user.id is not None
     uid = user.id
     User.by_id(uid, db_session=db_session) is not None
     user.delete()
     assert User.by_id(uid, db_session=db_session) is None
 def test_add_object_with_flush(self, db_session):
     user = User(user_name='some_new_user', email='foo')
     assert user.id is None
     user.persist(flush=True, db_session=db_session)
     assert user.id is not None
Example #4
0
 def test_add_object_with_flush(self, db_session):
     user = User(user_name='some_new_user', email='foo')
     assert user.id is None
     user.persist(flush=True, db_session=db_session)
     assert user.id is not None
Example #5
0
 def test_add_object_without_flush(self, db_session):
     user = User(user_name="some_new_user", email="foo")
     assert user.id is None
     user.persist(db_session=db_session)
     assert user.id is None