'Test for happy path'

@mock.patch('requests_oauthlib.oauth2_session.OAuth2Session.fetch_token', fetch_token_mock)
@mock.patch('requests_oauthlib.oauth2_session.OAuth2Session.post')
def test_course_info_to_ccxcon_ok(self, mock_post):

    mock_response = mock.Mock()
    mock_response.status_code = 201
    mock_post.return_value = mock_response
    ccxconapi.course_info_to_ccxcon(self.course_key)
    self.assertEqual(mock_post.call_count, 1)
    (k_args, k_kwargs) = mock_post.call_args
    self.assertEqual(k_args, tuple())
    self.assertEqual(k_kwargs.get('url'), urlparse.urljoin(self.course.ccx_connector, ccxconapi.CCXCON_COURSEXS_URL))
    mock_response.status_code = 200
    mock_post.return_value = mock_response
    ccxconapi.course_info_to_ccxcon(self.course_key)
    self.assertEqual(mock_post.call_count, 2)
    (k_args, k_kwargs) = mock_post.call_args
    self.assertEqual(k_args, tuple())
    self.assertEqual(k_kwargs.get('url'), urlparse.urljoin(self.course.ccx_connector, ccxconapi.CCXCON_COURSEXS_URL))
