Ejemplo n.º 1
0
 def setUp(self):
     self.app = create_app('testing')
     self.app_context = self.app.app_context()
     self.app_context.push()
     # db.engine.connect().connection.connection.text_factory = str
     db.create_all()
     self.client = self.app.test_client(use_cookies=True)
Ejemplo n.º 2
0
 def create_app(self):
     return create_app('testing')
Ejemplo n.º 3
0
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.script.commands import ShowUrls
from sqlalchemy.exc import IntegrityError

from suda import create_app, db
from suda.models import Client

COV = None
if os.environ.get('FLASK_COVERAGE'):
    import coverage

    COV = coverage.coverage(branch=True, include='suda/*')
    COV.start()

app = create_app(os.getenv('FLASK_CONFIG') or 'development')

manager = Manager(app)
migrate = Migrate(app, db)


def make_shell_context():
    return dict(app=app, db=db)


@manager.command
def test(coverage=False):
    """Run the unit test."""
    if coverage and not os.environ.get('FLASK_COVERAGE'):
        import sys
Ejemplo n.º 4
0
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.script.commands import ShowUrls
from sqlalchemy.exc import IntegrityError

from suda import create_app, db
from suda.models import Client

COV = None
if os.environ.get('FLASK_COVERAGE'):
    import coverage

    COV = coverage.coverage(branch=True, include='suda/*')
    COV.start()

app = create_app(os.getenv('FLASK_CONFIG') or 'development')

manager = Manager(app)
migrate = Migrate(app, db)


def make_shell_context():
    return dict(app=app, db=db)


@manager.command
def test(coverage=False):
    """Run the unit test."""
    if coverage and not os.environ.get('FLASK_COVERAGE'):
        import sys