Merge pull request #21484 from edx/BOM-264

BOM-264
This commit is contained in:
Ayub
2019-09-04 12:48:13 +05:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ Image encoding helpers for the verification app.
"""
from __future__ import absolute_import
import base64
import logging
log = logging.getLogger(__name__)
@@ -30,7 +31,7 @@ def decode_image_data(data):
"""
try:
return (data.split(",")[1]).decode("base64")
return base64.b64decode(data.split(",")[1])
except (IndexError, UnicodeEncodeError):
log.exception("Could not decode image data")
raise InvalidImageData

View File

@@ -1553,7 +1553,7 @@ class TestSubmitPhotosForVerification(TestCase):
# Since the user doesn't have an initial verification attempt, this should fail
response = self._submit_photos(expected_status_code=400, face_image=self.IMAGE_DATA)
self.assertEqual(
response.content,
response.content.decode('utf-8'),
"Photo ID image is required if the user does not have an initial verification attempt."
)