def test_development_config(self):
        """ Tests if the development config loads correctly """

        app = create_app('ticketplace.settings.DevelopmentConfig')

        assert app.config['DEBUG'] is True
        assert app.config['CACHE_TYPE'] == 'null'
    def test_test_config(self):
        """ Tests if the test config loads correctly """

        app = create_app('ticketplace.settings.TestConfig')

        assert app.config['DEBUG'] is True
        assert app.config['SQLALCHEMY_ECHO'] is False
        assert app.config['CACHE_TYPE'] == 'null'
Example #3
0
def testapp(request):
    app = create_app('ticketplace.settings.TestConfig')
    client = app.test_client()

    db.app = app
    db.create_all()

    def teardown():
        db.session.remove()
        db.drop_all()

    request.addfinalizer(teardown)

    return client
    def test_production_config(self):
        """ Tests if the production config loads correctly """

        app = create_app('ticketplace.settings.ProductionConfig')

        assert app.config['CACHE_TYPE'] == 'simple'
    def test_heroku_config(self):
        """ Tests if the heroku config loads correctly """

        app = create_app('ticketplace.settings.HerokuConfig')

        assert app.config['CACHE_TYPE'] == 'simple'
Example #6
0
#!/usr/bin/env python

import os

from flask.ext.script import Manager, Server
from flask.ext.script.commands import ShowUrls, Clean
from flask.ext.migrate import Migrate, MigrateCommand
from ticketplace import create_app
from ticketplace.models import db

# default to dev config because no one should use this in
# production anyway
config_name = os.environ.get('CONFIG', 'ticketplace.settings.DevelopmentConfig')
app = create_app(config_name)
migrate = Migrate(app=app,
                  db=db,
                  compare_type=True)

manager = Manager(app)
manager.add_command("server", Server())
manager.add_command("show-urls", ShowUrls())
manager.add_command("clean", Clean())
manager.add_command('db', MigrateCommand)


@manager.shell
def make_shell_context():
    """ Creates a python REPL with several default imports
        in the context of the app
    """
Example #7
0
""" WSGI file for Heroku Deployment
"""
from ticketplace import create_app

app = create_app('ticketplace.settings.HerokuConfig')