Files
edx-platform/lms/djangoapps/course_api/blocks/tests/helpers.py
Stu Young b0e6870271 INCR-286 Run python-modernize on lms/djangoapps/course_api/blocks/tests (#20593)
* run python modernize

* run isort

* Fix quality
2019-05-21 11:24:39 -04:00

15 lines
376 B
Python

"""
Helper functions for unit tests
"""
from __future__ import absolute_import
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)