def test_dev_config(self): app = create_app('pele.settings.DevelopmentConfig') assert app.config['DEBUG'] is True #assert app.config['SQLALCHEMY_DATABASE_URI'] == 'sqlite:///../database.db' assert app.config['SQLALCHEMY_ECHO'] is True assert app.config['CACHE_TYPE'] == 'null'
def setUp(self): app = create_app('pele.settings.DevelopmentConfig') self.app = app.test_client() db.app = app db.create_all() admin = User('admin', '*****@*****.**', 'supersafepassword') db.session.add(admin) db.session.commit()
def setUp(self): app = create_app('pele.settings.DevelopmentConfig') self.app = app.test_client() db.app = app db.create_all()
import os import sys import click import unittest import coverage from flask_migrate import Migrate, MigrateCommand from pele import create_app, db COV = coverage.coverage(branch=True, include='pele/*', omit=['pele/static/*', 'pele/templates/*']) COV.start() env = os.environ.get('FLASK_ENV', 'production') app = create_app('pele.settings.%sConfig' % env.capitalize()) migrate = Migrate(app, db) @app.shell_context_processor def make_shell_context(): return dict(app=app, db=db, User=User) @app.cli.command() def test(): """Runs the unit tests without test coverage.""" tests = unittest.TestLoader().discover('tests', pattern='test*.py') print(tests) result = unittest.TextTestRunner(verbosity=2).run(tests)
def test_prod_config(self): app = create_app('pele.settings.ProductionConfig')