Skip to content

test: migrate web forgot password controller tests to testcontainers#34288

Merged
asukaminato0721 merged 1 commit intolanggenius:mainfrom
YB0y:test/migrate-web-forgot-password-controller-tests-to-testcontainers
Mar 30, 2026
Merged

test: migrate web forgot password controller tests to testcontainers#34288
asukaminato0721 merged 1 commit intolanggenius:mainfrom
YB0y:test/migrate-web-forgot-password-controller-tests-to-testcontainers

Conversation

@YB0y
Copy link
Copy Markdown
Contributor

@YB0y YB0y commented Mar 30, 2026

Summary

Migrate tests from api/tests/unit_tests/controllers/web/test_web_forgot_password.py to testcontainers integration tests at api/tests/test_containers_integration_tests/controllers/web/test_web_forgot_password.py.

Replaced Flask(__name__) with flask_app_with_containers fixture. All 5 tests migrated: email normalization before sending reset email, email normalization for validity checks, token email case preservation, account fetching with case fallback, and password update with commit verification. External services (AccountService, Session, db) remain mocked as tests verify controller routing and email normalization logic.

Part of #32454

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues.
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint and make type-check (backend) and cd web && npx lint-staged (frontend) to appease the lint gods

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Pyrefly Diff

No changes detected.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Mar 30, 2026
@asukaminato0721 asukaminato0721 added this pull request to the merge queue Mar 30, 2026
Merged via the queue into langgenius:main with commit cc89b57 Mar 30, 2026
27 checks passed
@YB0y YB0y deleted the test/migrate-web-forgot-password-controller-tests-to-testcontainers branch April 1, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants