'Tests that 500 status code is received if invalid data was received from
EdXNotes service.'

@patch.dict('django.conf.settings.FEATURES', {'ENABLE_EDXNOTES': True})
@patch('edxnotes.views.get_notes', autospec=True)
def test_search_notes_exception(self, mock_search):

    mock_search.side_effect = EdxNotesParseError
    enable_edxnotes_for_the_course(self.course, self.user.id)
    response = self.client.get(self.notes_url, {'text': 'test'})
    self.assertEqual(response.status_code, 500)
    self.assertIn('error', response.content)
