mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #23614] [CLOSED] test: add integration tests for notes API #27276
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23614
Author: @mohi-devhub
Created: 4/12/2026
Status: ❌ Closed
Base:
dev← Head:test/notes-api-coverage📝 Commits (1)
423050atest: add integration tests for notes API📊 Changes
3 files changed (+551 additions, -0 deletions)
View changed files
➕
backend/open_webui/test/apps/webui/routers/test_notes.py(+343 -0)➕
backend/open_webui/test/util/abstract_integration_test.py(+163 -0)➕
backend/open_webui/test/util/mock_user.py(+45 -0)📄 Description
Pull Request Checklist
devbranch.test:Changelog Entry
Description
The notes API (
routers/notes.py) had no test coverage. This PR adds a full integration test suite for it, following the same pattern astest_users.py.It also introduces the shared test utilities (
AbstractPostgresTest,mock_webui_user) that the existing test files depend on but were previously absent from the repository.Added
backend/open_webui/test/apps/webui/routers/test_notes.py— 20 integration tests covering:USER_PERMISSIONSwrite_access: true), 404 for unknown ID, 403 for a non-owner with no access grant"to do"matches"to-do list")backend/open_webui/test/util/abstract_integration_test.py— Postgres Docker fixture base class (AbstractPostgresTest)backend/open_webui/test/util/mock_user.py— auth dependency override helper (mock_webui_user)Fixed
test_search_notes_multi_word_query) that validates the multi-word search normalization fix, ensuring queries like"to do"correctly match notes titled"to-do list"via hyphen/space stripping.Additional Information
Screenshots or Videos
N/A — backend tests only.
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.