'Test that certificate has been created and rendered properly with non-audit course mode.'

@mock.patch.dict('django.conf.settings.FEATURES', {'CERTIFICATES_HTML_VIEW': True})
def test_certificate_info_in_response(self):

    CourseModeFactory.create(course_id=self.course.id, mode_slug='verified')
    response = self.client.ajax_post(self._url(), data=CERTIFICATE_JSON_WITH_SIGNATORIES)
    self.assertEqual(response.status_code, 201)
    result = self.client.get_html(self._url())
    self.assertIn('Test    certificate', result.content)
    self.assertIn('Test    description', result.content)
    response = self.client.get_json(self._url())
    data = json.loads(response.content)
    self.assertEquals(len(data), 1)
    self.assertEqual(data[0]['name'], 'Test    certificate')
    self.assertEqual(data[0]['description'], 'Test    description')
    self.assertEqual(data[0]['version'], CERTIFICATE_SCHEMA_VERSION)
