'Test to make sure unicode data in a thread doesn\'t break it.'

@patch('lms.lib.comment_client.utils.requests.request', autospec=True)
def _test_unicode_data(self, text, mock_request):

    self._set_mock_request_data(mock_request, {})
    request = RequestFactory().post('dummy_url', {'thread_type': 'discussion', 'body': text, 'title': text})
    request.user = self.student
    request.view_name = 'create_thread'
    response = views.create_thread(request, course_id=unicode(self.course.id), commentable_id=u'non_t\xe5em_dummy_id')
    self.assertEqual(response.status_code, 200)
    self.assertTrue(mock_request.called)
    self.assertEqual(mock_request.call_args[1]['data']['body'], text)
    self.assertEqual(mock_request.call_args[1]['data']['title'], text)
