mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-24 10:13:01 +08:00
Initial commit
This commit is contained in:
22
api/tests/test_factory.py
Normal file
22
api/tests/test_factory.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
|
||||
import pytest
|
||||
|
||||
from app import create_app
|
||||
|
||||
def test_create_app():
|
||||
|
||||
# Test Default(CE) Config
|
||||
app = create_app()
|
||||
|
||||
assert app.config['SECRET_KEY'] is not None
|
||||
assert app.config['SQLALCHEMY_DATABASE_URI'] is not None
|
||||
assert app.config['EDITION'] == "SELF_HOSTED"
|
||||
|
||||
# Test TestConfig
|
||||
from config import TestConfig
|
||||
test_app = create_app(TestConfig())
|
||||
|
||||
assert test_app.config['SECRET_KEY'] is not None
|
||||
assert test_app.config['SQLALCHEMY_DATABASE_URI'] is not None
|
||||
assert test_app.config['TESTING'] is True
|
||||
Reference in New Issue
Block a user