Skip to content

Commit b355ff4

Browse files
committed
test: use a real UsageKey in StructuredTagsAsideTestCase
1 parent 5d6036b commit b355ff4

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

cms/lib/xblock/tagging/test.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import ddt
1111
from django.test.client import RequestFactory
1212
from lxml import etree
13-
from opaque_keys.edx.asides import AsideUsageKeyV1, AsideUsageKeyV2
13+
from opaque_keys.edx.asides import AsideUsageKeyV1, AsideUsageKeyV2, UsageKey
1414
from pytz import UTC
1515
from xblock.fields import ScopeIds
1616
from xblock.runtime import DictKeyValueStore, KvsFieldData
@@ -118,10 +118,12 @@ def test_aside_contains_tags(self):
118118
"""
119119
Checks that available_tags list is not empty
120120
"""
121-
sids = ScopeIds(user_id="bob",
122-
block_type="bobs-type",
123-
def_id="definition-id",
124-
usage_id="usage-id")
121+
sids = ScopeIds(
122+
user_id="bob",
123+
block_type="bobs-type",
124+
def_id="definition-id",
125+
usage_id=UsageKey.from_string("block-v1:myOrg+myCourse+myRun+type@bobs-type+block@usage-id"),
126+
)
125127
key_store = DictKeyValueStore()
126128
field_data = KvsFieldData(key_store)
127129
runtime = TestRuntime(services={'field-data': field_data})

0 commit comments

Comments
 (0)