app_fixture.py 491 B

12345678910111213141516171819202122232425
  1. import pytest
  2. from app_factory import create_app
  3. from configs import dify_config
  4. mock_user = type(
  5. "MockUser",
  6. (object,),
  7. {
  8. "is_authenticated": True,
  9. "id": "123",
  10. "is_editor": True,
  11. "is_dataset_editor": True,
  12. "status": "active",
  13. "get_id": "123",
  14. "current_tenant_id": "9d2074fc-6f86-45a9-b09d-6ecc63b9056b",
  15. },
  16. )
  17. @pytest.fixture
  18. def app():
  19. app = create_app()
  20. dify_config.LOGIN_DISABLED = True
  21. return app