Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add as_user flag to jobs fetch #431

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open

Add as_user flag to jobs fetch #431

wants to merge 24 commits into from

Conversation

Dagonite
Copy link
Collaborator

Closes #fiaisis/frontend#357

Description

Adds a as_user flag to the jobs endpoint which when true ignores whether the request was made by staff or not.

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.

Project coverage is 85.83%. Comparing base (df51c0c) to head (d13af7f).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
fia_api/router.py 0.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #431      +/-   ##
==========================================
+ Coverage   85.15%   85.83%   +0.68%     
==========================================
  Files          28       28              
  Lines         916      925       +9     
==========================================
+ Hits          780      794      +14     
+ Misses        136      131       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

test/e2e/test_core.py Outdated Show resolved Hide resolved
test/e2e/test_core.py Outdated Show resolved Hide resolved
Copy link
Member

@Pasarus Pasarus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the following tests to ensure execution branches are covered for jobs all:

  • As user is on and user, (should be default behaviour)
  • As user is off and user, (should be default behaviour)

Can we add the following tests to ensure execution branches are covered for jobs individual instrument:

  • As user is on and staff
  • As user is on and user, (should be default behaviour)
  • As user is off and user, (should be default behaviour)

assert len(response.json()) == expected_number_of_jobs


# def test_get_jobs_as_user_but_not_staff():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not have commented out tests?

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.

2 participants