Example #1
0
def create_test_user():

    app = CreateApp.Test()

    from caten_music import models

    models.db.create_all()

    # 建立已經啟動的帳號
    test_user = models.User(username="******",
                            email="*****@*****.**",
                            displayname="testDisplay",
                            password="******",
                            is_authenticated=True,
                            is_active=True)

    test_user.save()

    # 建立尚未啟動的帳號
    test_user_not_activated = models.User(
        username="******",
        email="*****@*****.**",
        displayname="testDisplay",
        password="******")

    test_user_not_activated.save()
Example #2
0
def dropAll():

    app = CreateApp.Test()

    from caten_music.models.base import db

    db.drop_all()
Example #3
0
def createAll():

    app = CreateApp.Test()

    from caten_music.models.base import db

    db.create_all()
Example #4
0
def client():

    app = CreateApp.Test()

    # db_fd, app.config["SQLALCHEMY_DATABASE_URI"] = tempfile.mkstemp()
    client = app.test_client()

    yield client