This repository has been archived by the owner on Nov 29, 2024. It is now read-only.
generated from communitiesuk/funding-service-design-TEMPLATE
-
Notifications
You must be signed in to change notification settings - Fork 0
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
4 changed files
with
65 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from config.key_report_mappings.model import FormMappingItem | ||
from config.key_report_mappings.model import KeyReportMapping | ||
|
||
DPIF_R2_KEY_REPORT_MAPPING = KeyReportMapping( | ||
round_id="0059aad4-5eb5-11ee-8c99-0242ac120002", | ||
mapping=[ | ||
FormMappingItem( | ||
form_name="organisation-information-dpi", | ||
key="IRugBv", | ||
return_field="applicant_email", | ||
), | ||
FormMappingItem( | ||
form_name="organisation-information-dpi", | ||
key="nYJiWy", | ||
return_field="organisation_name", | ||
), | ||
], | ||
) |
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
import pytest | ||
from config.key_report_mappings.cof_r3w2_key_report_mapping import ( | ||
COF_R3W2_KEY_REPORT_MAPPING, | ||
) | ||
from db.models import Applications | ||
from db.models import EndOfApplicationSurveyFeedback | ||
from db.models import Feedback | ||
|
@@ -13,7 +16,30 @@ | |
applications = [ | ||
Applications( | ||
id="app_1", | ||
forms=[Forms()], | ||
forms=[ | ||
Forms( | ||
name="applicant-information-cof-r3-w2", | ||
json=[ | ||
{ | ||
"questions": "Lead contact details", | ||
"fields": [{"key": "NlHSBg", "answer": "[email protected]"}], | ||
} | ||
], | ||
), | ||
Forms( | ||
name="organisation-information-cof-r3-w2", | ||
json=[ | ||
{ | ||
"questions": "organisation information", | ||
"fields": [ | ||
{"key": "WWWWxy", "answer": "Ref1234"}, | ||
{"key": "YdtlQZ", "answer": "OrgName"}, | ||
{"key": "lajFtB", "answer": "Non-Profit"}, | ||
], | ||
} | ||
], | ||
), | ||
], | ||
feedbacks=[ | ||
Feedback( | ||
section_id="62", | ||
|
@@ -48,20 +74,13 @@ | |
|
||
|
||
@pytest.mark.parametrize( | ||
"app_sections,applications", | ||
"app_sections,applications,report_mapping", | ||
[ | ||
( | ||
[ | ||
app_sections, | ||
applications, | ||
] | ||
), | ||
([app_sections, applications, COF_R3W2_KEY_REPORT_MAPPING]), | ||
], | ||
) | ||
def test_retrieve_all_feedbacks_and_surveys( | ||
mocker, | ||
app_sections, | ||
applications, | ||
mocker, app_sections, applications, report_mapping | ||
): | ||
mocker.patch( | ||
"db.queries.feedback.queries.get_application_sections", | ||
|
@@ -71,6 +90,10 @@ def test_retrieve_all_feedbacks_and_surveys( | |
"db.queries.feedback.queries.get_applications", | ||
return_value=applications, | ||
) | ||
mocker.patch( | ||
"db.queries.feedback.queries.get_report_mapping_for_round", | ||
return_value=report_mapping, | ||
) | ||
|
||
result = retrieve_all_feedbacks_and_surveys("test_fund", "test_round", "SUBMITTED") | ||
assert "sections_feedback" in result | ||
|