@async_mock.patch.object(test_module, 'MediationManager', autospec=True)
async def test_send_keylist_query(self, mock_manager):
    self.request.json.return_value = {'filter': {'test': 'filter'}}
    self.request.query = {'paginate_limit': 10, 'paginate_offset': 20}
    with async_mock.patch.object(test_module.MediationRecord, 'retrieve_by_id', async_mock.CoroutineMock(return_value=self.mock_record)) as mock_retrieve_by_id, async_mock.patch.object(mock_manager.return_value, 'prepare_keylist_query', async_mock.CoroutineMock()) as mock_prepare_keylist_query, async_mock.patch.object(test_module.web, 'json_response') as mock_response:
        (await test_module.send_keylist_query(self.request))
        mock_prepare_keylist_query.assert_called_once_with(filter_={'test': 'filter'}, paginate_limit=10, paginate_offset=20)
        self.outbound_message_router.assert_called()
        mock_response.assert_called_once_with(mock_prepare_keylist_query.return_value.serialize.return_value, status=201)
@async_mock.patch.object(test_module, 'MediationManager', autospec=True)
async def test_send_keylist_query(self, mock_manager):
    self.request.json.return_value = {'filter': {'test': 'filter'}}
    self.request.query = {'paginate_limit': 10, 'paginate_offset': 20}
    with async_mock.patch.object(test_module.MediationRecord, 'retrieve_by_id', async_mock.CoroutineMock(return_value=self.mock_record)) as mock_retrieve_by_id, async_mock.patch.object(mock_manager.return_value, 'prepare_keylist_query', async_mock.CoroutineMock()) as mock_prepare_keylist_query, async_mock.patch.object(test_module.web, 'json_response') as mock_response:
        (await test_module.send_keylist_query(self.request))
        mock_prepare_keylist_query.assert_called_once_with(filter_={'test': 'filter'}, paginate_limit=10, paginate_offset=20)
        self.outbound_message_router.assert_called()
        mock_response.assert_called_once_with(mock_prepare_keylist_query.return_value.serialize.return_value, status=201)