-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Rest Framework Tests: Improve speed and repeatability #10503
Conversation
Hi there 👋, @DryRunSecurity here, below is a summary of our analysis and findings.
Note 🟢 Risk threshold not exceeded. Change Summary (click to expand)The following is a summary of changes in this pull request made by me, your security buddy 🤖. Note that this summary is auto-generated and not meant to be a definitive list of security issues but rather a helpful summary from a security perspective. Summary: The changes in this pull request focus on improving the reliability, efficiency, and security of the DefectDojo application's unit tests and API endpoints. The key changes include:
These changes demonstrate a strong commitment to application security, as they focus on ensuring that the application's core functionality and data access are properly secured and tested. The changes address potential security concerns, such as unauthorized access, data leakage, and input validation, which are crucial for maintaining the overall security posture of the DefectDojo application. Files Changed:
Powered by DryRun Security |
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.
Approved
@kiblik I was not planning on figuring out the I also did not plan on the |
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.
Just a couple spots I wasn't sure about - otherwise this looks good! Very excited for faster, more stable test runs 😄
engagement = self.add_engagement_without_jira_project(expected_delta_jira_project_db=0) | ||
self.empty_jira_project_for_engagement(engagement, expected_delta_jira_project_db=0) | ||
self.assertEqual(jira_mock.call_count, 0) | ||
with contextlib.suppress(ValueError): |
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.
Could you add a comment about why suppressing ValueErrors is necessary here?
# expecting ValueError as we can't delete existing JIRA Projects | ||
self.empty_jira_project_for_engagement(engagement, expected_delta_jira_project_db=0, expect_error=True) | ||
self.assertEqual(jira_mock.call_count, 1) | ||
with contextlib.suppress(ValueError): |
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 as above - could you add a quick comment explaining this line?
No hard feelings 😄 I will be happy when it will be solved |
get_queryset
function for more flexible queryset manipulationid
[sc-6766]