Files
edx-platform/lms/djangoapps/course_api/blocks/tests/helpers.py
2019-12-30 12:25:38 -05:00

14 lines
337 B
Python

"""
Helper functions for unit tests
"""
from opaque_keys.edx.keys import UsageKey
def deserialize_usage_key(usage_key_string, course_key):
"""
Returns the deserialized UsageKey object of the given usage_key_string for the given course.
"""
return UsageKey.from_string(usage_key_string).replace(course_key=course_key)