async def test_request_mediation(self):
    body = {'mediator_terms': ['meaningless string because terms are not used'], 'recipient_terms': ["meaningless string because terms are not a 'thing'"]}
    self.request.json.return_value = body
    with async_mock.patch.object(test_module, 'MediationManager', autospec=True) as mock_med_mgr, async_mock.patch.object(test_module.web, 'json_response') as mock_response, async_mock.patch.object(test_module.MediationRecord, 'exists_for_connection_id', async_mock.CoroutineMock(return_value=False)) as mock_mediation_record_exists, async_mock.patch.object(test_module.ConnRecord, 'retrieve_by_id', async_mock.CoroutineMock()) as mock_conn_rec_retrieve_by_id:
        mock_med_mgr.return_value.prepare_request = async_mock.CoroutineMock(return_value=(self.mock_record, async_mock.MagicMock(serialize=async_mock.MagicMock(return_value={'a': 'value'}))))
        (await test_module.request_mediation(self.request))
        mock_response.assert_called_once_with(self.mock_record.serialize.return_value, status=201)
        self.outbound_message_router.assert_called()
async def test_request_mediation(self):
    body = {'mediator_terms': ['meaningless string because terms are not used'], 'recipient_terms': ["meaningless string because terms are not a 'thing'"]}
    self.request.json.return_value = body
    with async_mock.patch.object(test_module, 'MediationManager', autospec=True) as mock_med_mgr, async_mock.patch.object(test_module.web, 'json_response') as mock_response, async_mock.patch.object(test_module.MediationRecord, 'exists_for_connection_id', async_mock.CoroutineMock(return_value=False)) as mock_mediation_record_exists, async_mock.patch.object(test_module.ConnRecord, 'retrieve_by_id', async_mock.CoroutineMock()) as mock_conn_rec_retrieve_by_id:
        mock_med_mgr.return_value.prepare_request = async_mock.CoroutineMock(return_value=(self.mock_record, async_mock.MagicMock(serialize=async_mock.MagicMock(return_value={'a': 'value'}))))
        (await test_module.request_mediation(self.request))
        mock_response.assert_called_once_with(self.mock_record.serialize.return_value, status=201)
        self.outbound_message_router.assert_called()