def test_attach_to_cert_uuid_hex_string(self): setup_mock_response('AttachToCert') fake_app = app_factory() fake_cert = uuid4() data = _attach_to_cert(fake_app, fake_cert.get_hex()) eq_(data, {'ResultCode': 'Success', 'ErrorMessage': None, 'ErrorID': None}) expected_json = app_data(fake_app) expected_json['CertID'] = unicode(fake_cert) eq_(len(responses.calls), 1) eq_(responses.calls[0].request.url, urljoin(settings.IARC_V2_SERVICE_ENDPOINT, 'AttachToCert')) eq_(json.loads(responses.calls[0].request.body), expected_json)
def test_attach_to_cert_uuid_hex_string(self): setup_mock_response('AttachToCert') fake_app = app_factory() fake_cert = uuid4() data = _attach_to_cert(fake_app, fake_cert.get_hex()) eq_(data, {'ResultCode': 'Success', 'ErrorMessage': None, 'ErrorID': None}) expected_json = _iarc_app_data(fake_app) expected_json['CertID'] = unicode(fake_cert) eq_(len(responses.calls), 1) eq_(responses.calls[0].request.headers.get('StorePassword'), settings.IARC_V2_STORE_PASSWORD) eq_(responses.calls[0].request.headers.get('StoreID'), settings.IARC_V2_STORE_ID) eq_(json.loads(responses.calls[0].request.body), expected_json)
def test_attach_to_cert_uuid_hex_string(self): setup_mock_response('AttachToCert') fake_app = app_factory() fake_cert = uuid4() data = _attach_to_cert(fake_app, fake_cert.get_hex()) eq_(data, { 'ResultCode': 'Success', 'ErrorMessage': None, 'ErrorID': None }) expected_json = app_data(fake_app) expected_json['CertID'] = unicode(fake_cert) eq_(len(responses.calls), 1) eq_(responses.calls[0].request.url, urljoin(settings.IARC_V2_SERVICE_ENDPOINT, 'AttachToCert')) eq_(json.loads(responses.calls[0].request.body), expected_json)