test_factory.py 570 B

12345678910111213141516171819202122
  1. # -*- coding:utf-8 -*-
  2. import pytest
  3. from app import create_app
  4. def test_create_app():
  5. # Test Default(CE) Config
  6. app = create_app()
  7. assert app.config['SECRET_KEY'] is not None
  8. assert app.config['SQLALCHEMY_DATABASE_URI'] is not None
  9. assert app.config['EDITION'] == "SELF_HOSTED"
  10. # Test TestConfig
  11. from config import TestConfig
  12. test_app = create_app(TestConfig())
  13. assert test_app.config['SECRET_KEY'] is not None
  14. assert test_app.config['SQLALCHEMY_DATABASE_URI'] is not None
  15. assert test_app.config['TESTING'] is True