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

4213 improve views coverage #4500

Closed
wants to merge 13 commits into from
Closed

Conversation

anagradova
Copy link
Contributor

@anagradova anagradova commented Dec 3, 2024

PR Checklist: Submitter

Link to Issue
Link to main issue.

Note
Reformatted file with black, isort, and ran a flake8 test.

Added Tests:
EditSubmissionViewTests.setUp
EditSubmissionViewTests.test_redirect_not_logged_in
SubmissionViewTests.setUp
SubmissionViewTests.test_get_renders_template
SubmissionViewTests.def test_get_permission_denied_if_no_sac
SubmissionViewTests.def test_get_access_denied_for_unauthorized_user
SubmissionViewTests.test_post_valid_submission
SubmissionViewTests.test_post_validation_errors
SubmissionViewTests.test_post_transaction_error
SubmissionViewTests.test_post_permission_denied_if_no_sac
SubmissionGetTest.testValidSubmission
SubmissionStatusTests.test_get_login_required
SubmissionStatusTests.test_get_bad_report_id_returns_403
EditSubmissionTest.setUp
EditSubmissionTest.test_redirects_to_singleauditchecklist
AuditorCertificationStep1ViewTests.setUp
AuditorCertificationStep1ViewTests.test_get_redirects_if_status_not_ready_for_certification
AuditorCertificationStep1ViewTests.test_get_renders_template_if_valid_state
AuditorCertificationStep1ViewTests.test_get_permission_denied_if_sac_not_found
AuditorCertificationStep1ViewTests.test_post_redirects_if_status_not_ready_for_certification
AuditorCertificationStep1ViewTests.test_post_valid_form
AuditorCertificationStep1ViewTests.test_post_invalid_form
AuditorCertificationStep1ViewTests.test_post_permission_denied_if_sac_not_found
AuditeeCertificationStep2ViewTests.setUp
AuditeeCertificationStep2ViewTests.test_get_redirects_if_no_step_1
AuditeeCertificationStep2ViewTests.test_get_renders_template_if_valid_session
AuditeeCertificationStep2ViewTests.test_get_redirects_if_not_auditor_certified
AuditeeCertificationStep2ViewTests.test_redirects_if_no_step_1_session
AuditeeCertificationStep2ViewTests.test_post_valid_form
AuditeeCertificationStep2ViewTests.test_post_invalid_form
AuditeeCertificationStep2ViewTests.test_post_redirects_if_status_not_auditor_certified
AuditeeCertificationStep2ViewTests.test_single_audit_checklist_does_not_exist_exception
CrossValidationViewTests.setUp
CrossValidationViewTests.test_get_view_renders_correct_template
CrossValidationViewTests.test_get_view_permission_denied
CrossValidationViewTests.test_post_view_renders_results_template
CrossValidationViewTests.test_post_view_permission_denied

Test Command
To test the file only, use manage.py test audit.test_views

Last Merge
Main was merged to branch on 12/02/24

PR Checklist: Reviewer

  • Pull the branch to your local environment and run make docker-clean; make docker-first-run && docker compose up; then run docker compose exec web /bin/bash -c "python manage.py test"
  • Manually test out the changes locally, or check this box to verify that it wasn’t applicable in this case.
  • Check that the PR has appropriate tests. Look out for changes in HTML/JS/JSON Schema logic that may need to be captured in Python tests even though the logic isn’t in Python.
  • Verify that no Git surgery is necessary at any point (such as during a merge party), or, if it was, repeat the testing after it’s finished.

The larger the PR, the stricter we should be about these points.

Pre Merge Checklist: Merger

  • Ensure that prior to approving, the terraform plan is what we expect it to be. -/+ resource "null_resource" "cors_header" should be destroying and recreating its self and ~ resource "cloudfoundry_app" "clamav_api" might be updating its sha256 for the fac-file-scanner and fac-av-${ENV} by default.
  • Ensure that the branch is up to date with main.
  • Ensure that a terraform plan has been recently generated for the pull request.

Copy link
Contributor

github-actions bot commented Dec 3, 2024

Terraform plan for meta

No changes. Your infrastructure matches the configuration.
No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

📝 Plan generated in Pull Request Checks #4047

Copy link
Contributor

github-actions bot commented Dec 3, 2024

Terraform plan for dev

Plan: 1 to add, 0 to change, 1 to destroy.
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # module.dev.module.cors.null_resource.cors_header must be replaced
-/+ resource "null_resource" "cors_header" {
!~      id       = "*******************" -> (known after apply)
!~      triggers = { # forces replacement
!~          "always_run" = "2024-12-12T19:08:39Z" -> (known after apply)
        }
    }

Plan: 1 to add, 0 to change, 1 to destroy.

📝 Plan generated in Pull Request Checks #4047

backend/audit/test_views.py Outdated Show resolved Hide resolved
backend/audit/test_views.py Show resolved Hide resolved
backend/audit/test_views.py Show resolved Hide resolved
Copy link
Contributor

@jperson1 jperson1 left a comment

Choose a reason for hiding this comment

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

These changes look great, I'm just being picky

backend/audit/test_views.py Outdated Show resolved Hide resolved
backend/audit/test_views.py Outdated Show resolved Hide resolved
jperson1
jperson1 previously approved these changes Dec 6, 2024
jperson1
jperson1 previously approved these changes Dec 12, 2024
Copy link
Contributor

Code Coverage

Package Line Rate Branch Rate Health
. 100% 100%
api 98% 90%
audit 97% 87%
audit.cross_validation 98% 88%
audit.fixtures 84% 50%
audit.intakelib 90% 81%
audit.intakelib.checks 92% 85%
audit.intakelib.common 98% 82%
audit.intakelib.transforms 100% 95%
audit.management.commands 78% 17%
audit.migrations 100% 100%
audit.models 94% 76%
audit.templatetags 100% 100%
audit.views 71% 54%
census_historical_migration 96% 65%
census_historical_migration.migrations 100% 100%
census_historical_migration.sac_general_lib 92% 84%
census_historical_migration.transforms 95% 90%
census_historical_migration.workbooklib 68% 69%
config 76% 31%
curation 100% 100%
curation.curationlib 57% 100%
curation.migrations 100% 100%
dissemination 91% 70%
dissemination.migrations 97% 25%
dissemination.searchlib 74% 64%
dissemination.templatetags 100% 100%
djangooidc 53% 38%
djangooidc.tests 100% 94%
report_submission 93% 88%
report_submission.migrations 100% 100%
report_submission.templatetags 74% 100%
support 92% 62%
support.management.commands 96% 100%
support.migrations 100% 100%
support.models 97% 83%
tools 98% 50%
users 95% 92%
users.fixtures 100% 83%
users.management 100% 100%
users.management.commands 100% 100%
users.migrations 100% 100%
Summary 91% (17826 / 19588) 77% (2200 / 2874)

@anagradova
Copy link
Contributor Author

Changes added and merged in PR #4546

@anagradova anagradova deleted the 4213-improve-views-coverage branch December 13, 2024 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants