'Edit certificate, check its id and modified fields.'

def test_can_edit_certificate(self):

    self._add_course_certificates(count=2)
    expected = {u'id': 1, u'version': CERTIFICATE_SCHEMA_VERSION, u'name': u'New    test    certificate', u'description': u'New    test    description', u'is_active': True, u'course_title': u'Course    Title    Override', u'signatories': []}
    response = self.client.put(self._url(cid=1), 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.modified', course_id=unicode(self.course.id), configuration_id=1)
    self.reload_course()
    course_certificates = self.course.certificates['certificates']
    self.assertEqual(len(course_certificates), 2)
    self.assertEqual(course_certificates[1].get('name'), u'New    test    certificate')
    self.assertEqual(course_certificates[1].get('description'), 'New    test    description')
