Skip to content

fix(tests): restore require_api_key in saved_views auth rejection tests#2062

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

fix(tests): restore require_api_key in saved_views auth rejection tests#2062
SHAROZ221 wants to merge 2 commits into
utksh1:mainfrom
SHAROZ221:fix/saved-views-auth-tests

Conversation

@SHAROZ221

Copy link
Copy Markdown

Description

Fixes failing auth rejection unit tests in testing/backend/unit/test_saved_views.py (test_unauthenticated_request_rejected and test_wrong_api_key_rejected).

Because app_client fixture sets _app.dependency_overrides[require_api_key] = _mock_require_api_key, requests with empty or incorrect API keys were bypassing authentication and returning 200 OK instead of 401 Unauthorized.

This PR temporarily restores require_api_key for those two auth rejection tests, bringing test_saved_views.py to 47/47 PASSED (100%).

Contributed as part of GSSoC (GirlScript Summer of Code).

Related Issues

Fixes failing auth tests in testing/backend/unit/test_saved_views.py.

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 pytest directly on testing/backend/unit/test_saved_views.py:

.\venv_tests\Scripts\pytest testing/backend/unit/test_saved_views.py -v
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.
 I have made corresponding changes to the documentation.
 My changes generate no new warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant