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

FS-4446: Consistent CSV File Columns #500

Merged
merged 5 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/mappings/assessment_mapping_fund_round.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@
"score_fields": {
"Application ID",
"Short ID",
"Score Subcriteria",
"Score",
"Score Subcriteria",
"Score Date",
"Score Time",
},
Expand Down
2 changes: 1 addition & 1 deletion db/queries/assessment_records/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,8 @@ def get_assessment_records_score_data_by_round_id(round_id, selected_fields=None
default_fields = [
suegarner marked this conversation as resolved.
Show resolved Hide resolved
"Application ID",
"Short ID",
"Score Subcriteria",
"Score",
"Score Subcriteria",
suegarner marked this conversation as resolved.
Show resolved Hide resolved
"Score Justification",
"Score Date",
"Score Time",
Expand Down
52 changes: 52 additions & 0 deletions tests/test_db_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,58 @@ def test_output_tracker_with_no_scores_data(seed_application_records, mocker):
assert data["en_list"][0]["Risks to your project (document upload)"] == "sample1.doc"


@pytest.mark.apps_to_insert([test_input_data[0]])
def test_output_tracker_columns_remain_same_for_scored_and_unscored_reports(seed_application_records, mocker):
mocker.patch(
"db.queries.assessment_records.queries.get_account_name",
return_value="Test user",
)

picked_row = get_assessment_record(seed_application_records[0]["application_id"])

no_scores = get_assessment_export_data(
picked_row.fund_id,
picked_row.round_id,
"OUTPUT_TRACKER",
{
"OUTPUT_TRACKER": {
"form_fields": {
"KAgrBz": {"en": {"title": "Project name"}},
}
}
},
)

application_id = picked_row.application_id
sub_criteria_id = "app-info"

assessment_payload = {
"application_id": application_id,
"sub_criteria_id": sub_criteria_id,
"score": 5,
"justification": "great",
"user_id": "test",
}
create_score_for_app_sub_crit(**assessment_payload)

with_scores = get_assessment_export_data(
picked_row.fund_id,
picked_row.round_id,
"OUTPUT_TRACKER",
{
"OUTPUT_TRACKER": {
"form_fields": {
"KAgrBz": {"en": {"title": "Project name"}},
}
}
},
)

no_scores_cols = list(no_scores["en_list"][0].keys())
with_scores_cols = list(with_scores["en_list"][0].keys())[: len(no_scores_cols)]
assert no_scores_cols == with_scores_cols


@pytest.mark.apps_to_insert([test_input_data[4]]) # taken from assessment store for cof r4w1
def test_get_cof_r4w1_export_data_en(seed_application_records):
app_id = test_input_data[4]["id"]
Expand Down