@@ -89,12 +89,12 @@ def setUp(self):
8989 )
9090 self .collection = Collection .objects .create (
9191 learning_package = self .learning_package ,
92- key = "test_collection" ,
92+ collection_code = "test_collection" ,
9393 title = "Test Collection" ,
9494 )
9595 self .collection2 = Collection .objects .create (
9696 learning_package = self .learning_package ,
97- key = "test_collection2" ,
97+ collection_code = "test_collection2" ,
9898 title = "Test Collection 2" ,
9999 )
100100
@@ -426,7 +426,7 @@ def test_migrate_component_with_static_content(self):
426426 self .assertIsNone (reason ) # noqa: PT009
427427
428428 component_media = result .componentversion .componentversionmedia_set .filter (
429- key = "static/test_image.png"
429+ path = "static/test_image.png"
430430 ).first ()
431431 self .assertIsNotNone (component_media ) # noqa: PT009
432432 self .assertEqual (component_media .media .id , test_media .id ) # noqa: PT009
@@ -673,12 +673,12 @@ def test_migrate_component_content_filename_not_in_olx(self):
673673
674674 referenced_content_exists = (
675675 result .componentversion .componentversionmedia_set .filter (
676- key = "static/referenced.png"
676+ path = "static/referenced.png"
677677 ).exists ()
678678 )
679679 unreferenced_content_exists = (
680680 result .componentversion .componentversionmedia_set .filter (
681- key = "static/unreferenced.png"
681+ path = "static/unreferenced.png"
682682 ).exists ()
683683 )
684684
@@ -718,7 +718,7 @@ def test_migrate_container_creates_new_container(self):
718718 component_type = content_api .get_or_create_component_type (
719719 "xblock.v1" , "problem"
720720 ),
721- local_key = "child_problem_1" ,
721+ component_code = "child_problem_1" ,
722722 created = timezone .now (),
723723 created_by = self .user .id ,
724724 )
@@ -734,7 +734,7 @@ def test_migrate_container_creates_new_container(self):
734734 component_type = content_api .get_or_create_component_type (
735735 "xblock.v1" , "html"
736736 ),
737- local_key = "child_html_1" ,
737+ component_code = "child_html_1" ,
738738 created = timezone .now (),
739739 created_by = self .user .id ,
740740 )
@@ -906,7 +906,7 @@ def test_migrate_container_preserves_child_order(self):
906906 component_type = content_api .get_or_create_component_type (
907907 "xblock.v1" , "problem"
908908 ),
909- local_key = f"child_problem_{ i } " ,
909+ component_code = f"child_problem_{ i } " ,
910910 created = timezone .now (),
911911 created_by = self .user .id ,
912912 )
@@ -946,7 +946,7 @@ def test_migrate_container_with_mixed_child_types(self):
946946 component_type = content_api .get_or_create_component_type (
947947 "xblock.v1" , "problem"
948948 ),
949- local_key = "mixed_problem" ,
949+ component_code = "mixed_problem" ,
950950 created = timezone .now (),
951951 created_by = self .user .id ,
952952 )
@@ -962,7 +962,7 @@ def test_migrate_container_with_mixed_child_types(self):
962962 component_type = content_api .get_or_create_component_type (
963963 "xblock.v1" , "html"
964964 ),
965- local_key = "mixed_html" ,
965+ component_code = "mixed_html" ,
966966 created = timezone .now (),
967967 created_by = self .user .id ,
968968 )
@@ -978,7 +978,7 @@ def test_migrate_container_with_mixed_child_types(self):
978978 component_type = content_api .get_or_create_component_type (
979979 "xblock.v1" , "video"
980980 ),
981- local_key = "mixed_video" ,
981+ component_code = "mixed_video" ,
982982 created = timezone .now (),
983983 created_by = self .user .id ,
984984 )
0 commit comments