예제 #1
0
파일: test_config.py 프로젝트: hysds/pele
    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'
예제 #2
0
파일: test_login.py 프로젝트: hysds/pele
 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()
예제 #3
0
파일: test_models.py 프로젝트: hysds/pele
 def setUp(self):
     app = create_app('pele.settings.DevelopmentConfig')
     self.app = app.test_client()
     db.app = app
     db.create_all()
예제 #4
0
파일: app.py 프로젝트: hysds/pele
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)
예제 #5
0
파일: test_config.py 프로젝트: hysds/pele
 def test_prod_config(self):
     app = create_app('pele.settings.ProductionConfig')