Ejemplo n.º 1
0
def client():
    app.config['TESTING'] = True
    os.environ["DATABASE_URL"] = "sqlite:///:memory:"
    client = app.test_client()

    cleanup()  # clean up before every test

    db.create_all()

    yield client
Ejemplo n.º 2
0
def client_logged_in():
    app.config['TESTING'] = True
    os.environ["DATABASE_URL"] = "sqlite:///:memory:"
    client = app.test_client()

    cleanup()  # clean up before every test

    db.create_all()

    # SIGNUP
    password = "******"
    client.post('/signup', data={"username": "******", "password": password, "repeat": password}, follow_redirects=True)

    yield client
Ejemplo n.º 3
0
from flask import Flask

from models.settings import db

from handlers.auth import auth_handlers
from handlers.topic import topic_handlers
from handlers.comment import comment_handlers

app = Flask(__name__)
app.register_blueprint(auth_handlers)
app.register_blueprint(topic_handlers)
app.register_blueprint(comment_handlers)
db.create_all()

if __name__ == '__main__':
    app.run(debug=True)