-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3000 from GSA-TTS/main
2023-12-13 main -> prod
- Loading branch information
Showing
77 changed files
with
1,100 additions
and
288 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 |
---|---|---|
|
@@ -25,6 +25,94 @@ def _make_user_and_sac(**kwargs): | |
return user, sac | ||
|
||
|
||
class ChangeOrAddRoleViewTests(TestCase): | ||
""" | ||
GET and POST tests for adding editors to a submission. | ||
""" | ||
|
||
role = "editor" | ||
view = "audit:ChangeOrAddRoleView" | ||
|
||
def test_basic_get(self): | ||
""" | ||
A user should be able to access this page for a SAC they're associated with. | ||
""" | ||
user, sac = _make_user_and_sac() | ||
baker.make(Access, user=user, sac=sac, role="editor") | ||
sac.general_information = {"auditee_uei": "YESIAMAREALUEI"} | ||
sac.save() | ||
|
||
self.client.force_login(user) | ||
url = reverse(self.view, kwargs={"report_id": sac.report_id}) | ||
response = self.client.get(url) | ||
|
||
self.assertEqual(response.status_code, 200) | ||
self.assertIn("YESIAMAREALUEI", response.content.decode("UTF-8")) | ||
|
||
def test_basic_post(self): | ||
""" | ||
Submitting the form with a new email address should create a new Access. | ||
""" | ||
user = baker.make(User, email="[email protected]") | ||
sac = baker.make(SingleAuditChecklist) | ||
baker.make(Access, user=user, sac=sac, role="editor") | ||
sac.general_information = {"auditee_uei": "YESIAMAREALUEI"} | ||
sac.save() | ||
self.client.force_login(user) | ||
|
||
data = { | ||
"fullname": "The New Editor", | ||
"email": "[email protected]", | ||
} | ||
|
||
url = reverse(self.view, kwargs={"report_id": sac.report_id}) | ||
response = self.client.post(url, data=data) | ||
self.assertEqual(302, response.status_code) | ||
|
||
newaccess = Access.objects.get( | ||
sac=sac, fullname=data["fullname"], email=data["email"] | ||
) | ||
self.assertEqual(self.role, newaccess.role) | ||
|
||
def test_login_required(self): | ||
"""When an unauthenticated request is made""" | ||
|
||
response = self.client.get( | ||
reverse( | ||
self.view, | ||
kwargs={"report_id": "12345"}, | ||
) | ||
) | ||
|
||
self.assertEqual(response.status_code, 403) | ||
|
||
def test_bad_report_id_returns_403(self): | ||
""" | ||
When a request is made for a malformed or nonexistent report_id, | ||
a 403 error should be returned | ||
""" | ||
user = baker.make(User) | ||
|
||
self.client.force_login(user) | ||
|
||
response = self.client.get( | ||
reverse(self.view, kwargs={"report_id": "this is not a report id"}) | ||
) | ||
|
||
self.assertEqual(response.status_code, 403) | ||
|
||
def test_inaccessible_audit_returns_403(self): | ||
"""When a request is made for an audit that is inaccessible for this user, a 403 error should be returned""" | ||
user, sac = _make_user_and_sac() | ||
|
||
self.client.force_login(user) | ||
response = self.client.post( | ||
reverse(self.view, kwargs={"report_id": sac.report_id}) | ||
) | ||
|
||
self.assertEqual(response.status_code, 403) | ||
|
||
|
||
class ChangeAuditorCertifyingOfficialViewTests(TestCase): | ||
""" | ||
GET and POST tests for changing auditor certifying official. | ||
|
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
Binary file modified
BIN
-1 Byte
(100%)
...l_migration/fixtures/workbooks/should_pass/177310-22/additional-eins-workbook-177310.xlsx
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
...l_migration/fixtures/workbooks/should_pass/177310-22/additional-ueis-workbook-177310.xlsx
Binary file not shown.
Binary file modified
BIN
-2 Bytes
(100%)
...gration/fixtures/workbooks/should_pass/177310-22/audit-findings-text-workbook-177310.xlsx
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
...tion/fixtures/workbooks/should_pass/177310-22/corrective-action-plan-workbook-177310.xlsx
Binary file not shown.
Binary file modified
BIN
-2 Bytes
(100%)
...xtures/workbooks/should_pass/177310-22/federal-awards-audit-findings-workbook-177310.xlsx
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
...al_migration/fixtures/workbooks/should_pass/177310-22/federal-awards-workbook-177310.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...cal_migration/fixtures/workbooks/should_pass/177310-22/notes-to-sefa-workbook-177310.xlsx
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
...igration/fixtures/workbooks/should_pass/177310-22/secondary-auditors-workbook-177310.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...l_migration/fixtures/workbooks/should_pass/180818-22/additional-eins-workbook-180818.xlsx
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
...l_migration/fixtures/workbooks/should_pass/180818-22/additional-ueis-workbook-180818.xlsx
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
...gration/fixtures/workbooks/should_pass/180818-22/audit-findings-text-workbook-180818.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...tion/fixtures/workbooks/should_pass/180818-22/corrective-action-plan-workbook-180818.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...xtures/workbooks/should_pass/180818-22/federal-awards-audit-findings-workbook-180818.xlsx
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
...al_migration/fixtures/workbooks/should_pass/180818-22/federal-awards-workbook-180818.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...cal_migration/fixtures/workbooks/should_pass/180818-22/notes-to-sefa-workbook-180818.xlsx
Binary file not shown.
Binary file modified
BIN
+1 Byte
(100%)
...igration/fixtures/workbooks/should_pass/180818-22/secondary-auditors-workbook-180818.xlsx
Binary file not shown.
Binary file modified
BIN
+1 Byte
(100%)
...l_migration/fixtures/workbooks/should_pass/217653-22/additional-eins-workbook-217653.xlsx
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
...l_migration/fixtures/workbooks/should_pass/217653-22/additional-ueis-workbook-217653.xlsx
Binary file not shown.
Binary file modified
BIN
+2 Bytes
(100%)
...gration/fixtures/workbooks/should_pass/217653-22/audit-findings-text-workbook-217653.xlsx
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
...tion/fixtures/workbooks/should_pass/217653-22/corrective-action-plan-workbook-217653.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...xtures/workbooks/should_pass/217653-22/federal-awards-audit-findings-workbook-217653.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...al_migration/fixtures/workbooks/should_pass/217653-22/federal-awards-workbook-217653.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...cal_migration/fixtures/workbooks/should_pass/217653-22/notes-to-sefa-workbook-217653.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...igration/fixtures/workbooks/should_pass/217653-22/secondary-auditors-workbook-217653.xlsx
Binary file not shown.
Binary file modified
BIN
+1 Byte
(100%)
...l_migration/fixtures/workbooks/should_pass/251020-22/additional-eins-workbook-251020.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...l_migration/fixtures/workbooks/should_pass/251020-22/additional-ueis-workbook-251020.xlsx
Binary file not shown.
Binary file modified
BIN
-2 Bytes
(100%)
...gration/fixtures/workbooks/should_pass/251020-22/audit-findings-text-workbook-251020.xlsx
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
...tion/fixtures/workbooks/should_pass/251020-22/corrective-action-plan-workbook-251020.xlsx
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
...xtures/workbooks/should_pass/251020-22/federal-awards-audit-findings-workbook-251020.xlsx
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
...al_migration/fixtures/workbooks/should_pass/251020-22/federal-awards-workbook-251020.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...cal_migration/fixtures/workbooks/should_pass/251020-22/notes-to-sefa-workbook-251020.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...igration/fixtures/workbooks/should_pass/251020-22/secondary-auditors-workbook-251020.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...cal_migration/fixtures/workbooks/should_pass/69688-22/additional-eins-workbook-69688.xlsx
Binary file not shown.
Binary file modified
BIN
-1 Byte
(100%)
...cal_migration/fixtures/workbooks/should_pass/69688-22/additional-ueis-workbook-69688.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...migration/fixtures/workbooks/should_pass/69688-22/audit-findings-text-workbook-69688.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...ration/fixtures/workbooks/should_pass/69688-22/corrective-action-plan-workbook-69688.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...fixtures/workbooks/should_pass/69688-22/federal-awards-audit-findings-workbook-69688.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...ical_migration/fixtures/workbooks/should_pass/69688-22/federal-awards-workbook-69688.xlsx
Binary file not shown.
Binary file modified
BIN
+1 Byte
(100%)
...rical_migration/fixtures/workbooks/should_pass/69688-22/notes-to-sefa-workbook-69688.xlsx
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
..._migration/fixtures/workbooks/should_pass/69688-22/secondary-auditors-workbook-69688.xlsx
Binary file not shown.
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
Oops, something went wrong.