mattdrayer/SOL-981: Integrate edx-organizations application
* asadiqbal08/SOL-1058: Add edx-organizations to certificate web view * Support organization logo asset management * Remove organization fields from Studio certificate configuration model * SOL-981 pull request feedback fixes
This commit is contained in:
@@ -1033,7 +1033,6 @@ class CourseMetadataEditingTest(CourseTestCase):
|
||||
'id': 1,
|
||||
'name': 'Certificate Config Name',
|
||||
'course_title': 'Title override',
|
||||
'org_logo_path': '/c4x/test/CSS101/asset/org_logo.png',
|
||||
'signatories': [],
|
||||
'is_active': True
|
||||
}
|
||||
|
||||
@@ -177,8 +177,6 @@ class CertificateManager(object):
|
||||
"name": certificate_data['name'],
|
||||
"description": certificate_data['description'],
|
||||
"version": CERTIFICATE_SCHEMA_VERSION,
|
||||
"org_logo_path": certificate_data.get('org_logo_path', ''),
|
||||
"is_active": certificate_data.get('is_active', False),
|
||||
"signatories": certificate_data['signatories']
|
||||
}
|
||||
|
||||
@@ -231,7 +229,6 @@ class CertificateManager(object):
|
||||
if int(cert['id']) == int(certificate_id):
|
||||
certificate = course.certificates['certificates'][index]
|
||||
# Remove any signatory assets prior to dropping the entire cert record from the course
|
||||
_delete_asset(course.id, certificate['org_logo_path'])
|
||||
for sig_index, signatory in enumerate(certificate.get('signatories')): # pylint: disable=unused-variable
|
||||
_delete_asset(course.id, signatory['signature_image_path'])
|
||||
# Now drop the certificate record
|
||||
|
||||
@@ -93,13 +93,11 @@ class HelperMethods(object):
|
||||
'id': i,
|
||||
'name': 'Name ' + str(i),
|
||||
'description': 'Description ' + str(i),
|
||||
'org_logo_path': '/c4x/test/CSS101/asset/org_logo{}.png'.format(i),
|
||||
'signatories': signatories,
|
||||
'version': CERTIFICATE_SCHEMA_VERSION,
|
||||
'is_active': is_active
|
||||
} for i in xrange(0, count)
|
||||
]
|
||||
self._create_fake_images([certificate['org_logo_path'] for certificate in certificates])
|
||||
self.course.certificates = {'certificates': certificates}
|
||||
self.save_course()
|
||||
|
||||
@@ -219,8 +217,6 @@ class CertificatesListHandlerTestCase(EventTestMixin, CourseTestCase, Certificat
|
||||
u'version': CERTIFICATE_SCHEMA_VERSION,
|
||||
u'name': u'Test certificate',
|
||||
u'description': u'Test description',
|
||||
u'org_logo_path': '',
|
||||
u'is_active': False,
|
||||
u'signatories': []
|
||||
}
|
||||
response = self.client.ajax_post(
|
||||
@@ -388,8 +384,6 @@ class CertificatesDetailHandlerTestCase(EventTestMixin, CourseTestCase, Certific
|
||||
u'name': u'Test certificate',
|
||||
u'description': u'Test description',
|
||||
u'course_title': u'Course Title Override',
|
||||
u'org_logo_path': '',
|
||||
u'is_active': False,
|
||||
u'signatories': []
|
||||
}
|
||||
|
||||
@@ -420,8 +414,6 @@ class CertificatesDetailHandlerTestCase(EventTestMixin, CourseTestCase, Certific
|
||||
u'name': u'New test certificate',
|
||||
u'description': u'New test description',
|
||||
u'course_title': u'Course Title Override',
|
||||
u'org_logo_path': '',
|
||||
u'is_active': False,
|
||||
u'signatories': []
|
||||
|
||||
}
|
||||
@@ -453,11 +445,6 @@ class CertificatesDetailHandlerTestCase(EventTestMixin, CourseTestCase, Certific
|
||||
Delete certificate
|
||||
"""
|
||||
self._add_course_certificates(count=2, signatory_count=1)
|
||||
certificates = self.course.certificates['certificates']
|
||||
org_logo_url = certificates[1]['org_logo_path']
|
||||
image_asset_location = AssetLocation.from_deprecated_string(org_logo_url)
|
||||
content = contentstore().find(image_asset_location)
|
||||
self.assertIsNotNone(content)
|
||||
response = self.client.delete(
|
||||
self._url(cid=1),
|
||||
content_type="application/json",
|
||||
@@ -474,8 +461,6 @@ class CertificatesDetailHandlerTestCase(EventTestMixin, CourseTestCase, Certific
|
||||
# Verify that certificates are properly updated in the course.
|
||||
certificates = self.course.certificates['certificates']
|
||||
self.assertEqual(len(certificates), 1)
|
||||
# make sure certificate org logo is deleted too
|
||||
self.assertRaises(NotFoundError, contentstore().find, image_asset_location)
|
||||
self.assertEqual(certificates[0].get('name'), 'Name 0')
|
||||
self.assertEqual(certificates[0].get('description'), 'Description 0')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user