'Tests that requests are send with correct information.'

@override_settings(EDXNOTES_PUBLIC_API='http://example.com')
@override_settings(EDXNOTES_INTERNAL_API='http://example.com')
@patch('edxnotes.helpers.anonymous_id_for_user', autospec=True)
@patch('edxnotes.helpers.get_edxnotes_id_token', autospec=True)
@patch('edxnotes.helpers.requests.get', autospec=True)
def test_send_request_with_text_param(self, mock_get, mock_get_id_token, mock_anonymous_id_for_user):

    mock_get_id_token.return_value = 'test_token'
    mock_anonymous_id_for_user.return_value = 'anonymous_id'
    helpers.send_request(self.user, self.course.id, path='test', text='text', page=helpers.DEFAULT_PAGE, page_size=helpers.DEFAULT_PAGE_SIZE)
    mock_get.assert_called_with('http://example.com/test/', headers={'x-annotator-auth-token': 'test_token'}, params={'user': 'anonymous_id', 'course_id': unicode(self.course.id), 'text': 'text', 'highlight': True, 'page': 1, 'page_size': 25}, timeout=(settings.EDXNOTES_CONNECT_TIMEOUT, settings.EDXNOTES_READ_TIMEOUT))
