test: add unit tests for verification engine waterfall and codeplus vendor adapters
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 29s

This commit is contained in:
vickytechkey 2026-10-16 13:49:45 +05:30
parent 4e60430b73
commit 722f15a89e
2 changed files with 6 additions and 4 deletions

View file

@ -735,7 +735,7 @@ class VerificationAPITests(TestCase):
self.assertFalse(res.data["is_success"])
self.assertEqual(res.data["status"], "NAME_MISMATCH")
self.assertFalse(res.data["data"]["name_matched"])
self.assertIn("Name mismatch", res.data["error_message"])
self.assertIn("PAN Name Mismatch", res.data["error_message"])
# DB persistence check
tx = VerificationTransaction.objects.get(reference_id=res.data["reference_id"])

View file

@ -330,15 +330,17 @@ class SellerPanGstVerifyView(APIView):
if gst_error:
overall_success = False
overall_status = "GSTIN_PAN_MISMATCH"
error_msg = gst_error
error_msg = f"GSTIN Mismatch: {gst_error}"
elif not pan_name_matched:
overall_success = False
overall_status = "NAME_MISMATCH"
error_msg = f"Name mismatch: The entered name '{seller_name}' does not match PAN record '{verified_pan_name}' ({match_result.get('reason', '')})"
pan_reason = match_result.get('reason', '')
error_msg = f"PAN Name Mismatch: The entered seller name '{seller_name}' does not match government PAN record '{verified_pan_name}'. ({pan_reason})"
elif target_gstin and not gst_name_matched:
overall_success = False
overall_status = "GST_NAME_MISMATCH"
error_msg = f"Name mismatch: The entered name '{seller_name}' does not match GST legal name '{verified_gst_name}' ({gst_name_match.get('reason', '')})"
gst_reason = gst_name_match.get('reason', '')
error_msg = f"GST Name Mismatch: The entered seller name '{seller_name}' does not match government GST legal name '{verified_gst_name}'. ({gst_reason})"
else:
overall_success = pan_result.is_success and pan_name_matched
overall_status = "SUCCESS" if overall_success else "FAILED"