'Create two IdentityProvider entities with some remote_ids.
A remote_id is the same for both so the second IdP is not
created because of the uniqueness of the remote_ids
Expect HTTP 409 Conflict code for the latter call.'

def test_create_idp_remote_repeated(self):

    body = self.default_body.copy()
    repeated_remote_id = uuid.uuid4().hex
    body['remote_ids'] = [uuid.uuid4().hex, uuid.uuid4().hex, uuid.uuid4().hex, repeated_remote_id]
    self._create_default_idp(body=body)
    url = self.base_url(suffix=uuid.uuid4().hex)
    body['remote_ids'] = [uuid.uuid4().hex, repeated_remote_id]
    resp = self.put(url, body={'identity_provider': body}, expected_status=http_client.CONFLICT)
    resp_data = jsonutils.loads(resp.body)
    self.assertIn('Duplicate    remote    ID', resp_data.get('error', {}).get('message'))
