@@ -1324,6 +1324,13 @@ def test_status_transition(self):
13241324 self .eap_registration .latest_simplified_eap .review_checklist_file ,
13251325 )
13261326
1327+ # Fails, As NS has to revise the EAP before transitioning to UNDER_REVIEW.
1328+ status_data = {
1329+ "status" : EAPStatus .UNDER_REVIEW ,
1330+ }
1331+ response = self .client .post (self .url , status_data )
1332+ self .assertEqual (response .status_code , 400 , response .data )
1333+
13271334 # Fails, As User only can revise after NS_ADDRESSING_COMMENTS, cannot update directly as it's locked
13281335 update_data ["modified_at" ] = datetime .now ()
13291336 response = self .client .patch (url , update_data , format = "json" )
@@ -1452,6 +1459,13 @@ def test_status_transition(self):
14521459 self .assertEqual (response .status_code , 200 , response .data )
14531460 self .assertEqual (response .data ["status" ], EAPStatus .NS_ADDRESSING_COMMENTS )
14541461
1462+ # Fails, As NS has to revise the EAP before transitioning to UNDER_REVIEW.
1463+ status_data = {
1464+ "status" : EAPStatus .UNDER_REVIEW ,
1465+ }
1466+ response = self .client .post (self .url , status_data )
1467+ self .assertEqual (response .status_code , 400 , response .data )
1468+
14551469 # Cannot update as it is in NS_ADDRESSING_COMMENTS, only revise is allowed
14561470 update_data ["modified_at" ] = datetime .now ()
14571471 response = self .client .patch (url , update_data , format = "json" )
@@ -1587,6 +1601,13 @@ def test_status_transition(self):
15871601 self .assertEqual (response .status_code , 200 , response .data )
15881602 self .assertEqual (response .data ["status" ], EAPStatus .NS_ADDRESSING_COMMENTS )
15891603
1604+ # Fails, As NS has to revise the EAP before transitioning to UNDER_REVIEW.
1605+ status_data = {
1606+ "status" : EAPStatus .UNDER_REVIEW ,
1607+ }
1608+ response = self .client .post (self .url , status_data )
1609+ self .assertEqual (response .status_code , 400 , response .data )
1610+
15901611 revise_url = f"/api/v2/simplified-eap/{ third_snapshot .id } /revise/"
15911612 self .authenticate (self .country_admin )
15921613 response = self .client .post (revise_url )
@@ -1737,7 +1758,7 @@ def test_status_transition(self):
17371758 # FAILS As simplified EAP is in PENDING_PFA, cannot updated
17381759 url = f"/api/v2/simplified-eap/{ simplified_eap .id } /"
17391760 response = self .client .patch (url , update_data , format = "json" )
1740- self .assertEqual (response .status_code , 400 )
1761+ self .assertEqual (response .status_code , 400 , response . data )
17411762
17421763 # NOTE: Transition to APPROVED
17431764 # PENDING_PFA -> APPROVED
@@ -1767,7 +1788,7 @@ def test_status_transition(self):
17671788 self .authenticate (self .country_admin )
17681789 url = f"/api/v2/simplified-eap/{ simplified_eap .id } /"
17691790 response = self .client .patch (url , update_data , format = "json" )
1770- self .assertEqual (response .status_code , 400 )
1791+ self .assertEqual (response .status_code , 400 , response . data )
17711792
17721793 @mock .patch ("eap.serializers.generate_export_eap_pdf" )
17731794 @mock .patch ("eap.serializers.group" )
0 commit comments