You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gcgj-dify-1.7.0/api/tests/unit_tests
-LAN- a82d75bf60
test: add comprehensive unit tests for EmailI18nService
- Created comprehensive test suite with 19 test cases covering all EmailI18nService functionality
- Implemented mock classes (MockEmailRenderer, MockBrandingService, MockEmailSender) following protocol pattern
- Avoided using patch decorator, instead using constructor dependency injection for cleaner testing
- Tests cover:
  * Email sending with different languages (English, Chinese, fallback handling)
  * Branding enabled/disabled scenarios
  * Change email workflows (old/new phases)
  * Raw email sending (single and multiple recipients)
  * Error handling for invalid phases and missing templates
  * Subject templating with variables
  * Integration tests for default configuration and service creation
  * Flask-specific components (renderer and sender)

The tests follow DDD principles with proper separation of concerns and use
dependency injection rather than mocking frameworks for cleaner, more maintainable tests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
7 months ago
..
configs chore: add SQLALCHEMY_POOL_USE_LIFO option and missing SQLALCHEMY_POOL_PRE_PING env default value. (#22371) 7 months ago
controllers test: add comprehensive OAuth authentication unit tests (#22528) 7 months ago
core refactor: decouple Node and NodeData (#22581) 7 months ago
extensions feat: add redis fallback mechanism #21043 (#21044) 7 months ago
factories refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025) 7 months ago
libs test: add comprehensive unit tests for EmailI18nService 7 months ago
models feat(libs): Introduce `extract_tenant_id` (#22086) 7 months ago
oss chore(lint): correct allowed-unused-imports settings for cleanup unused imports in tests (#11922) 1 year ago
repositories feat(workflow_cycle_manager): Removes redundant repository methods and adds caching (#22597) 7 months ago
services test: add comprehensive unit tests for AuthType (#22742) 7 months ago
utils Support OAuth Integration for Plugin Tools (#22550) 7 months ago
.gitignore Enhance Code Consistency Across Repository with `.editorconfig` (#19023) 9 months ago
__init__.py FEAT: NEW WORKFLOW ENGINE (#3160) 2 years ago
conftest.py fix: resolve Redis mock import error in test configuration (#22663) 7 months ago