def test_user(db_session): """ Creates a single test user """ user = users.test_user() db_session.add(user) db_session.commit() return user
def bootstrap(): from sqlalchemy.exc import IntegrityError try: db.session.add(test_admin()) db.session.add(test_user()) db.session.commit() except IntegrityError, e: print('Warning, there was a problem adding your auth data, it may have already been added:', e) db.session.rollback()
def bootstrap(): from sqlalchemy.exc import IntegrityError try: db.session.add(test_admin()) db.session.add(test_user()) db.session.commit() except IntegrityError as e: print('Warning, there was a problem adding your auth data, it may have already been added:', e) db.session.rollback()