-
-
Notifications
You must be signed in to change notification settings - Fork 278
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 Project-Teams API tests #5631
base: develop
Are you sure you want to change the base?
Conversation
- Add projects-teams API endpoint tests - Fix project teams exceptions and retrieval of user id
d950790
to
db00081
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
response_body["Error"], "User is not an admin or a manager for the team" | ||
) | ||
self.assertEqual(response_body["SubCode"], "UserPermissionError") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test to determine if 403 is raised when the user does not have permission to update the project appears to be missing as well. Only a team's user permission is tested in the test above
Also test to determine whether a 400 is raised when an invalid team role is passed appears to be missing.
self.assertEqual(response.status_code, 403) | ||
self.assertEqual(response_body["Error"], "User is not a manager of the project") | ||
self.assertEqual(response_body["SubCode"], "UserPermissionError") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here a test to determine whether a 400 is raised when an invalid team role is passed appears to be missing.
This PR handles project-teams related API endpoint tests.
How to test:
test_
git fetch origin && git checkout chore/add-project-teams-tests
python3 -m unittest discover tests/backend