1616from cms .djangoapps .contentstore .helpers import StaticFileNotices
1717from cms .djangoapps .contentstore .tests .utils import CourseTestCase
1818from cms .djangoapps .contentstore .xblock_storage_handlers import view_handlers as xblock_view_handlers
19- from cms .djangoapps .contentstore .xblock_storage_handlers .xblock_helpers import get_block_key_dict
19+ from cms .djangoapps .contentstore .xblock_storage_handlers .xblock_helpers import get_block_key_string
2020from cms .lib .xblock .upstream_sync import BadUpstream , UpstreamLink
2121from common .djangoapps .student .auth import add_users
2222from common .djangoapps .student .roles import CourseStaffRole
@@ -157,7 +157,7 @@ def setUp(self):
157157 parent = self .top_level_downstream_unit ,
158158 upstream = self .html_lib_id_2 ,
159159 upstream_version = 1 ,
160- top_level_downstream_parent_key = get_block_key_dict (
160+ top_level_downstream_parent_key = get_block_key_string (
161161 self .top_level_downstream_unit .usage_key ,
162162 )
163163 ).usage_key
@@ -171,7 +171,7 @@ def setUp(self):
171171 parent = self .top_level_downstream_chapter ,
172172 upstream = self .top_level_subsection_id ,
173173 upstream_version = 1 ,
174- top_level_downstream_parent_key = get_block_key_dict (
174+ top_level_downstream_parent_key = get_block_key_string (
175175 self .top_level_downstream_chapter .usage_key ,
176176 ),
177177 )
@@ -180,7 +180,7 @@ def setUp(self):
180180 parent = self .top_level_downstream_sequential ,
181181 upstream = self .top_level_unit_id_2 ,
182182 upstream_version = 1 ,
183- top_level_downstream_parent_key = get_block_key_dict (
183+ top_level_downstream_parent_key = get_block_key_string (
184184 self .top_level_downstream_chapter .usage_key ,
185185 ),
186186 )
@@ -189,7 +189,7 @@ def setUp(self):
189189 parent = self .top_level_downstream_unit_2 ,
190190 upstream = self .video_lib_id_2 ,
191191 upstream_version = 1 ,
192- top_level_downstream_parent_key = get_block_key_dict (
192+ top_level_downstream_parent_key = get_block_key_string (
193193 self .top_level_downstream_chapter .usage_key ,
194194 )
195195 ).usage_key
@@ -455,17 +455,14 @@ def test_unlink_parent_should_update_children_top_level_parent(self):
455455
456456 unit = modulestore ().get_item (self .top_level_downstream_unit_2 .usage_key )
457457 # The sequential is the top-level parent for the unit
458- assert unit . top_level_downstream_parent_key == {
459- "id" : str ( self .top_level_downstream_sequential .usage_key . block_id ),
460- "type" : str ( self . top_level_downstream_sequential . usage_key . block_type ),
461- }
458+ sequential_block_key = get_block_key_string (
459+ self .top_level_downstream_sequential .usage_key
460+ )
461+ assert unit . top_level_downstream_parent_key == sequential_block_key
462462
463463 video = modulestore ().get_item (self .top_level_downstream_video_key )
464464 # The sequential is the top-level parent for the video
465- assert video .top_level_downstream_parent_key == {
466- "id" : str (self .top_level_downstream_sequential .usage_key .block_id ),
467- "type" : str (self .top_level_downstream_sequential .usage_key .block_type ),
468- }
465+ assert video .top_level_downstream_parent_key == sequential_block_key
469466
470467 all_downstreams = self .client .get (
471468 "/api/contentstore/v2/downstreams/" ,
@@ -1249,8 +1246,6 @@ def test_200_get_ready_to_sync_top_level_parents_with_components(self):
12491246 'downstream_is_modified' : False ,
12501247 },
12511248 ]
1252- print (data ["results" ])
1253- print (expected )
12541249 self .assertListEqual (data ["results" ], expected )
12551250
12561251 def test_200_get_ready_to_sync_top_level_parents_with_containers (self ):
0 commit comments