Exemple #1
0
    def test_report_other(self, mock_url, mock_request):
        """
        Assert reporting for 'Other' makes the correct API call
        """
        mock_url.__get__ = mock.Mock(return_value='https://www.yikyak.com/')

        message = Message()
        message.report(0, block=False)

        # Expected API call
        method = 'PUT'
        url = 'https://www.yikyak.com/report'
        params = {
            'userLat': 0,
            'userLong': 0,
        }
        json = {
            'block': False,
            'reason': 'Other',
        }

        mock_request.assert_called_with(method, url, params=params, json=json)