@@ -428,7 +428,7 @@ def test_metadata_inherit(self):
428428
429429 def check_for_key (key , node , value ):
430430 "recursive check for presence of key"
431- print (f"Checking { str (node .location )} " )
431+ print (f"Checking { str (node .usage_key )} " )
432432 assert getattr (node , key ) == value
433433 for c in node .get_children ():
434434 check_for_key (key , c , value )
@@ -442,8 +442,8 @@ def test_policy_loading(self):
442442 toy = self .get_course ('toy' )
443443 two_toys = self .get_course ('two_toys' )
444444
445- assert toy .url_name == '2012_Fall'
446- assert two_toys .url_name == 'TT_2012_Fall'
445+ assert toy .usage_key . block_id == '2012_Fall'
446+ assert two_toys .usage_key . block_id == 'TT_2012_Fall'
447447
448448 toy_ch = toy .get_children ()[0 ]
449449 two_toys_ch = two_toys .get_children ()[0 ]
@@ -513,7 +513,7 @@ def test_colon_in_url_name(self):
513513 assert len (chapters ) == 5
514514
515515 ch2 = chapters [1 ]
516- assert ch2 .url_name == 'secret:magic'
516+ assert ch2 .usage_key . block_id == 'secret:magic'
517517
518518 print ("Ch2 location: " , ch2 .location )
519519
@@ -567,8 +567,8 @@ def test_url_name_mangling(self):
567567 for i in (2 , 3 ):
568568 video = sections [i ]
569569 # Name should be 'video_{hash}'
570- print (f"video { i } url_name: { video .url_name } " )
571- assert len (video .url_name ) == (len ('video_' ) + 12 )
570+ print (f"video { i } url_name: { video .usage_key . block_id } " )
571+ assert len (video .usage_key . block_id ) == (len ('video_' ) + 12 )
572572
573573 def test_poll_and_conditional_import (self ):
574574 modulestore = XMLModuleStore (DATA_DIR , source_dirs = ['conditional_and_poll' ])
0 commit comments