'PUT/POST new certificate.'

def test_can_create_new_certificate_if_it_does_not_exist(self):

    expected = {u'id': 666, u'version': CERTIFICATE_SCHEMA_VERSION, u'name': u'Test    certificate', u'description': u'Test    description', u'is_active': True, u'course_title': u'Course    Title    Override', u'signatories': []}
    response = self.client.put(self._url(cid=666), data=json.dumps(expected), content_type='application/json', HTTP_ACCEPT='application/json', HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    content = json.loads(response.content)
    self.assertEqual(content, expected)
    self.assert_event_emitted('edx.certificate.configuration.created', course_id=unicode(self.course.id), configuration_id=666)
