'Delete an existing certificate signatory'

@ddt.data(C4X_SIGNATORY_PATH, SIGNATORY_PATH)
def test_can_delete_signatory(self, signatory_path):

    self._add_course_certificates(count=2, signatory_count=3, asset_path_format=signatory_path)
    certificates = self.course.certificates['certificates']
    signatory = certificates[1].get('signatories')[1]
    image_asset_location = AssetKey.from_string(signatory['signature_image_path'])
    content = contentstore().find(image_asset_location)
    self.assertIsNotNone(content)
    test_url = '{}/signatories/1'.format(self._url(cid=1))
    response = self.client.delete(test_url, content_type='application/json', HTTP_ACCEPT='application/json', HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    self.assertEqual(response.status_code, 204)
    self.reload_course()
    certificates = self.course.certificates['certificates']
    self.assertEqual(len(certificates[1].get('signatories')), 2)
    self.assertRaises(NotFoundError, contentstore().find, image_asset_location)
