Пример #1
0
def bootstrap():
    from sqlalchemy.exc import IntegrityError
    try:
        u = User()
        u.first_name = u'Example'
        u.last_name = u'Manager'
        u.email_address = u'*****@*****.**'
        u.password = u'managepass'
        u.admin = True

        db.session.add(u)

        u1 = User()
        u1.first_name = u'Example'
        u1.last_name = u'User'
        u1.email_address = u'*****@*****.**'
        u1.password = u'test'
        u1.tracking_key = 123456

        db.session.add(u1)

        db.session.commit()
    except IntegrityError:
        print 'Warning, there was a problem adding your auth data, it may have already been added:'
        import traceback
        print traceback.format_exc()
        db.session.rollback()
        print 'Continuing with bootstrapping...'
Пример #2
0
def test_admin():
    u = User()
    u.first_name = u'Example'
    u.last_name = u'Manager'
    u.email_address = u'*****@*****.**'
    u.password = u.original_password = u'managepass'
    u.admin = True
    return u
Пример #3
0
def test_admin():
    u = User()
    u.first_name = u'Example'
    u.last_name = u'Manager'
    u.email_address = u'*****@*****.**'
    u.password = u.original_password = u'managepass'
    u.admin = True
    return u
Пример #4
0
def test_admin():
    u = User()
    u.first_name = u"Example"
    u.last_name = u"Manager"
    u.email_address = u"*****@*****.**"
    u.password = u.original_password = u"managepass"
    u.admin = True
    return u
Пример #5
0
def test_admin():
    u = User()
    u.first_name = u"Example"
    u.last_name = u"Manager"
    u.email_address = u"*****@*****.**"
    u.password = u.original_password = u"managepass"
    u.admin = True
    return u