def test_export_request_deserialize_from_json(): export_request_json = { 'scope': { 'typeName': 'courseContext', 'definition': { 'courseId': fake_course_id } } } export_request = ExportRequest.from_json(export_request_json) assert ExportRequest(course_id=fake_course_id) == export_request
def from_json(cls, json_request): """ Deserialize ExportRequestWithMetadata from json object. :param json_request: :return export_request: ExportRequestWithMetadata """ export_request = ExportRequest.from_json(json_request) return cls.from_export_request( export_request=export_request, id=json_request.get('id'), status=json_request.get('status'), download_link=json_request.get('downloadLink'), metadata=ExportRequestMetadata.from_json( json_request.get('metadata')))