Commit a1a58db9 by Bill DeRusha

Do not send initial verification photo_id if new photo_id provided

ECOM-2888
parent 03487073
......@@ -1427,7 +1427,8 @@ class TestSubmitPhotosForVerification(TestCase):
"AWS_ACCESS_KEY": "c987c7efe35c403caa821f7328febfa1",
"AWS_SECRET_KEY": "fc595fc657c04437bb23495d8fe64881",
"S3_BUCKET": "test.example.com",
}
},
"DAYS_GOOD_FOR": 10,
})
@httpretty.activate
@moto.mock_s3
......@@ -1470,6 +1471,16 @@ class TestSubmitPhotosForVerification(TestCase):
self.assertNotEqual(initial_photo_response.content, reverification_photo_response.content)
# Submit a new face photo and photo id for verification
self._submit_photos(
face_image=self.IMAGE_DATA + "9999",
photo_id_image=self.IMAGE_DATA + "1111",
)
two_photo_reverification_data = self._get_post_data()
# Verify that the initial attempt sent a new ID photo for the reverification attempt
self.assertNotEqual(initial_data["PhotoIDKey"], two_photo_reverification_data["PhotoIDKey"])
@ddt.data('face_image', 'photo_id_image')
def test_invalid_image_data(self, invalid_param):
params = {
......
......@@ -872,6 +872,11 @@ class SubmitPhotosView(View):
face_image, photo_id_image, response = self._decode_image_data(
params["face_image"], params.get("photo_id_image")
)
# If we have a photo_id we do not want use the initial verification image.
if photo_id_image is not None:
initial_verification = None
if response is not None:
return response
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment