Exemple #1
0
def test_user(db_session):
    """
    Creates a single test user
    """
    user = users.test_user()
    db_session.add(user)
    db_session.commit()
    return user
Exemple #2
0
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()
Exemple #3
0
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()