added sqlalchemy exception testing