def test_development_config(): app = create_app() app.config.from_object('chatbot.config.DevelopmentConfig') assert app.config['SECRET_KEY'] == 'dev' assert current_app is not None assert not app.config['TESTING']
def test_production_config(): app = create_app() app.config.from_object('chatbot.config.ProductionConfig') assert app.config['SECRET_KEY'] == 'prod' assert not app.config['TESTING'] assert app.config['LANGUAGE_CODE'] == 'ko-KR'
def app(): # setUp app = create_app() app.config.from_object('chatbot.config.TestingConfig') yield app # tearDown pass
def chatbot_start(): from chatbot import create_app app = create_app() app.run()
from flask.cli import FlaskGroup from dotenv import load_dotenv from chatbot import create_app load_dotenv() app = create_app() cli = FlaskGroup(app) if __name__ == '__main__': cli()
def test_config(): assert not create_app().testing
def test_testing_config(): app = create_app() app.config.from_object('chatbot.config.TestingConfig') assert app.config['SECRET_KEY'] == 'test'