From 7ec0dd9746161a2bdfb550504cb903f2694842a8 Mon Sep 17 00:00:00 2001 From: Janne Juhola <62986222+JanneJuhola@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:35:50 +0200 Subject: [PATCH] fix: In application cloning force origin to be applicant (#3653) * fix: In application cloning force origin to be applicant * fix:Use APPLICANT as source of test application * fix:lower case to upper * fix:added . * fix:Imports are incorrectly sorted --- backend/benefit/applications/services/clone_application.py | 3 ++- backend/benefit/applications/tests/test_application_clone.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/benefit/applications/services/clone_application.py b/backend/benefit/applications/services/clone_application.py index 9bd5477de7..317ae80a0b 100644 --- a/backend/benefit/applications/services/clone_application.py +++ b/backend/benefit/applications/services/clone_application.py @@ -5,6 +5,7 @@ from applications.enums import ( AhjoStatus as AhjoStatusEnum, + ApplicationOrigin, ApplicationStatus, ApplicationStep, AttachmentType, @@ -42,7 +43,7 @@ def clone_application_based_on_other( "alternative_company_postcode": application_base.alternative_company_postcode, "alternative_company_street_address": application_base.alternative_company_street_address, "applicant_language": "fi", - "application_origin": application_base.application_origin, + "application_origin": ApplicationOrigin.APPLICANT, "application_step": ApplicationStep.STEP_1, "archived": False, "association_has_business_activities": application_base.association_has_business_activities diff --git a/backend/benefit/applications/tests/test_application_clone.py b/backend/benefit/applications/tests/test_application_clone.py index d9526a80ce..dbf3782744 100755 --- a/backend/benefit/applications/tests/test_application_clone.py +++ b/backend/benefit/applications/tests/test_application_clone.py @@ -241,7 +241,7 @@ def _set_up_decided_application(): co_operation_negotiations_description="Very co-operation. Much contract.", paper_application_date="2024-10-23", pay_subsidy_granted=PaySubsidyGranted.GRANTED, - application_origin=ApplicationOrigin.HANDLER, + application_origin=ApplicationOrigin.APPLICANT, application_step=ApplicationStep.STEP_6, batch=ApplicationBatchFactory( proposal_for_decision=ApplicationStatus.ACCEPTED,