@@ -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
|
||||
|
||||
@@ -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."
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user