Skip to content

fix(tests): fix saved views auth rejection tests in test_saved_views.py - #2244

Closed
trivikramkalagi91-commits wants to merge 2 commits into
utksh1:mainfrom
trivikramkalagi91-commits:fix/saved-views-auth-tests
Closed

fix(tests): fix saved views auth rejection tests in test_saved_views.py#2244
trivikramkalagi91-commits wants to merge 2 commits into
utksh1:mainfrom
trivikramkalagi91-commits:fix/saved-views-auth-tests

Conversation

@trivikramkalagi91-commits

@trivikramkalagi91-commits trivikramkalagi91-commits commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Description

Fix two failing test cases (test_unauthenticated_request_rejected and test_wrong_api_key_rejected) in testing/backend/unit/test_saved_views.py.

These tests were failing because app_client is pre-configured with a mock dependency override for require_api_key that always returns success. This fix temporarily deletes the override from the app's dependency_overrides dictionary during the test execution and restores it in a finally block, ensuring that unauthenticated and incorrect key requests are correctly rejected with a 401 Unauthorized status.

Related Issues

Fixes test regressions introduced in PR #2051 (closes #1770 ).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Ran the saved views unit test suite locally:

  • Command: .\venv\Scripts\pytest testing/backend/unit/test_saved_views.py -v
  • Result: 47 passed, 0 failed (previously failed with 2 errors).

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.

@trivikramkalagi91-commits

Copy link
Copy Markdown
Contributor Author

hey @utksh1 this PR is raised because to solve the failing test in the PR #2051 which is raised to solve the issue number #1770 to merge the PR #2051 this should be merged first

@utksh1 utksh1 added area:backend Backend API, database, or service work level:beginner 20 pts difficulty label for small beginner-friendly PRs type:testing Testing work category bonus label labels Jul 30, 2026 — with ChatGPT Codex Connector

utksh1 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Closing as superseded by #2193. It duplicates the saved-view authentication coverage and also carries unrelated package-lock changes.

@utksh1 utksh1 closed this Jul 30, 2026
@utksh1 utksh1 added the gssoc:invalid Admin validation: invalid for GSSoC scoring label Jul 30, 2026 — with ChatGPT Codex Connector
@trivikramkalagi91-commits
trivikramkalagi91-commits deleted the fix/saved-views-auth-tests branch July 30, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Backend API, database, or service work gssoc:invalid Admin validation: invalid for GSSoC scoring level:beginner 20 pts difficulty label for small beginner-friendly PRs type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[#24] Vault blob has no key-version/id marker for rotation

2 participants