def mock_software_secure_post(url, headers=None, data=None, **kwargs):
 data_dict = json.loads(data)
 EXPECTED_KEYS = ['EdX-ID', 'ExpectedName', 'PhotoID', 'PhotoIDKey', 'SendResponseTo', 'UserPhoto', 'UserPhotoKey']
 for key in EXPECTED_KEYS:
  assert_true(data_dict.get(key), "'{}' must be present and not blank in JSON submitted to Software Secure".format(key))
 data_dict['PhotoIDKey'].decode('base64')
 data_dict['UserPhotoKey'].decode('base64')
 response = requests.Response()
 response.status_code = 200
 return response

def mock_software_secure_post ( url , headers = None , data = None , ** kwargs ) : data_dict = json . loads ( data ) EXPECTED_KEYS = [ 'EdX-ID' , 'ExpectedName' , 'PhotoID' , 'PhotoIDKey' , 'SendResponseTo' , 'UserPhoto' , 'UserPhotoKey' ] for key in EXPECTED_KEYS : assert_true ( data_dict . get ( key ) , "'{}' must be present and not blank in JSON submitted to Software Secure" . format ( key ) ) data_dict [ 'PhotoIDKey' ] . decode ( 'base64' ) data_dict [ 'UserPhotoKey' ] . decode ( 'base64' ) response = requests . Response ( ) response . status_code = 200 return response
mocks our interface when we post to software secure .