'Test that a user can successfully post on course updates and handouts of a course'

@patch('contentstore.push_notification.send_push_course_update')
def test_post_course_update(self, mock_push_update):

    self.post_course_update()
    self.assertFalse(mock_push_update.called)
    updates_location = self.course.id.make_usage_key('course_info', 'updates')
    self.assertTrue(isinstance(updates_location, UsageKey))
    self.assertEqual(updates_location.name, u'updates')
    handouts_location = self.course.id.make_usage_key('course_info', 'handouts')
    course_handouts_url = reverse_usage_url('xblock_handler', handouts_location)
    content = u'Sample    handout'
    payload = {'data': content}
    resp = self.client.ajax_post(course_handouts_url, payload)
    self.assertEqual(resp.status_code, 200)
    payload = json.loads(resp.content)
    self.assertHTMLEqual(payload['data'], content)
