'Update existing service provider.
Update default existing service provider and make sure it has been
properly changed.'

def test_update_service_provider(self):

    new_sp_ref = self.sp_ref()
    url = self.base_url(suffix=self.SERVICE_PROVIDER_ID)
    resp = self.patch(url, body={'service_provider': new_sp_ref})
    patch_result = resp.result
    new_sp_ref['id'] = self.SERVICE_PROVIDER_ID
    self.assertValidEntity(patch_result['service_provider'], ref=new_sp_ref, keys_to_check=self.SP_KEYS)
    resp = self.get(url)
    get_result = resp.result
    self.assertDictEqual(patch_result['service_provider'], get_result['service_provider'])
