-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
829 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 4.2.1 on 2023-06-17 00:25 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("audit", "0023_alter_access_role"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="excelfile", | ||
name="form_section", | ||
field=models.CharField(default="not-actually-default", max_length=255), | ||
), | ||
] |
17 changes: 17 additions & 0 deletions
17
backend/audit/migrations/0025_alter_excelfile_form_section.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 4.2.1 on 2023-06-17 06:27 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("audit", "0024_excelfile_form_section"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="excelfile", | ||
name="form_section", | ||
field=models.CharField(max_length=255), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,10 +22,7 @@ | |
FINDINGS_TEXT_ENTRY_FIXTURES, | ||
FINDINGS_UNIFORM_GUIDANCE_ENTRY_FIXTURES, | ||
FEDERAL_AWARDS_ENTRY_FIXTURES, | ||
FEDERAL_AWARDS_EXPENDED, | ||
CORRECTIVE_ACTION_PLAN, | ||
FINDINGS_TEXT, | ||
FINDINGS_UNIFORM_GUIDANCE, | ||
FORM_SECTIONS, | ||
) | ||
from .models import Access, SingleAuditChecklist | ||
from .views import MySubmissions | ||
|
@@ -56,13 +53,6 @@ | |
"auditor_contacts": ["[email protected]"], | ||
} | ||
|
||
EXCEL_FILES = [ | ||
CORRECTIVE_ACTION_PLAN, | ||
FEDERAL_AWARDS_EXPENDED, | ||
FINDINGS_UNIFORM_GUIDANCE, | ||
FINDINGS_TEXT, | ||
] | ||
|
||
|
||
# Mocking the user login and file scan functions | ||
def _mock_login_and_scan(client, mock_scan_file): | ||
|
@@ -262,7 +252,7 @@ class ExcelFileHandlerViewTests(TestCase): | |
def test_login_required(self): | ||
"""When an unauthenticated request is made""" | ||
|
||
for form_section in EXCEL_FILES: | ||
for form_section in FORM_SECTIONS: | ||
response = self.client.post( | ||
reverse( | ||
f"audit:{form_section}", | ||
|
@@ -278,7 +268,7 @@ def test_bad_report_id_returns_403(self): | |
|
||
self.client.force_login(user) | ||
|
||
for form_section in EXCEL_FILES: | ||
for form_section in FORM_SECTIONS: | ||
response = self.client.post( | ||
reverse( | ||
f"audit:{form_section}", | ||
|
@@ -296,7 +286,7 @@ def test_inaccessible_audit_returns_403(self): | |
user, sac = _make_user_and_sac() | ||
|
||
self.client.force_login(user) | ||
for form_section in EXCEL_FILES: | ||
for form_section in FORM_SECTIONS: | ||
response = self.client.post( | ||
reverse( | ||
f"audit:{form_section}", | ||
|
@@ -313,7 +303,7 @@ def test_no_file_attached_returns_400(self): | |
|
||
self.client.force_login(user) | ||
|
||
for form_section in EXCEL_FILES: | ||
for form_section in FORM_SECTIONS: | ||
response = self.client.post( | ||
reverse( | ||
f"audit:{form_section}", | ||
|
@@ -332,7 +322,7 @@ def test_invalid_file_upload_returns_400(self): | |
|
||
file = SimpleUploadedFile("not-excel.txt", b"asdf", "text/plain") | ||
|
||
for form_section in EXCEL_FILES: | ||
for form_section in FORM_SECTIONS: | ||
response = self.client.post( | ||
reverse( | ||
f"audit:{form_section}", | ||
|
@@ -365,10 +355,10 @@ def test_valid_file_upload_for_federal_awards(self, mock_scan_file): | |
with open(tmp.name, "rb") as excel_file: | ||
response = self.client.post( | ||
reverse( | ||
f"audit:{EXCEL_FILES[1]}", | ||
f"audit:{FORM_SECTIONS.FEDERAL_AWARDS_EXPENDED}", | ||
kwargs={ | ||
"report_id": sac.report_id, | ||
"form_section": EXCEL_FILES[1], | ||
"form_section": FORM_SECTIONS.FEDERAL_AWARDS_EXPENDED, | ||
}, | ||
), | ||
data={"FILES": excel_file}, | ||
|
@@ -488,10 +478,10 @@ def test_valid_file_upload_for_corrective_action_plan(self, mock_scan_file): | |
with open(tmp.name, "rb") as excel_file: | ||
response = self.client.post( | ||
reverse( | ||
f"audit:{EXCEL_FILES[0]}", | ||
f"audit:{FORM_SECTIONS.CORRECTIVE_ACTION_PLAN}", | ||
kwargs={ | ||
"report_id": sac.report_id, | ||
"form_section": EXCEL_FILES[0], | ||
"form_section": FORM_SECTIONS.CORRECTIVE_ACTION_PLAN, | ||
}, | ||
), | ||
data={"FILES": excel_file}, | ||
|
@@ -554,10 +544,10 @@ def test_valid_file_upload_for_findings_uniform_guidance(self, mock_scan_file): | |
with open(tmp.name, "rb") as excel_file: | ||
response = self.client.post( | ||
reverse( | ||
f"audit:{EXCEL_FILES[2]}", | ||
f"audit:{FORM_SECTIONS.FINDINGS_UNIFORM_GUIDANCE}", | ||
kwargs={ | ||
"report_id": sac.report_id, | ||
"form_section": EXCEL_FILES[2], | ||
"form_section": FORM_SECTIONS.FINDINGS_UNIFORM_GUIDANCE, | ||
}, | ||
), | ||
data={"FILES": excel_file}, | ||
|
@@ -632,10 +622,10 @@ def test_valid_file_upload_for_findings_text(self, mock_scan_file): | |
with open(tmp.name, "rb") as excel_file: | ||
response = self.client.post( | ||
reverse( | ||
f"audit:{EXCEL_FILES[3]}", | ||
f"audit:{FORM_SECTIONS.FINDINGS_TEXT}", | ||
kwargs={ | ||
"report_id": sac.report_id, | ||
"form_section": EXCEL_FILES[3], | ||
"form_section": FORM_SECTIONS.FINDINGS_TEXT, | ||
}, | ||
), | ||
data={"FILES": excel_file}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.