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

Updates to test_views.py from old branch #4546

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

anagradova
Copy link
Contributor

PR Checklist: Submitter

Link to Issue
Link to main issue.

Note
Reformatted file with black, isort, and ran a flake8 test. This is a clone PR of #4500 to deal with commit signing.

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.

4213-improve-views-coverage
Copy link
Contributor

github-actions bot commented Dec 13, 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 applied in Deploy to Development and Management Environment #887

Copy link
Contributor

github-actions bot commented Dec 13, 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 applied in Deploy to Development and Management Environment #887

backend/audit/test_views.py Outdated Show resolved Hide resolved
backend/audit/test_views.py Outdated Show resolved Hide resolved
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% (17854 / 19617) 77% (2203 / 2878)

@anagradova anagradova added this pull request to the merge queue Dec 13, 2024
Merged via the queue into main with commit d231bda Dec 13, 2024
15 checks passed
@anagradova anagradova deleted the 4213-x-improve-views-coverage branch December 13, 2024 19:45
@anagradova anagradova mentioned this pull request Dec 13, 2024
7 tasks
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