@@ -193,7 +193,7 @@ def setUp(self) -> None:
193193 with freeze_time (self .created_date ):
194194 self .collection = content_api .create_collection (
195195 learning_package_id = self .learning_package .id ,
196- key = "MYCOL" ,
196+ collection_code = "MYCOL" ,
197197 title = "my_collection" ,
198198 created_by = None ,
199199 description = "my collection description"
@@ -203,7 +203,7 @@ def setUp(self) -> None:
203203 )
204204 self .collection_dict = {
205205 "id" : "lib-collectionorg1libmycol-5b647617" ,
206- "block_id" : self .collection .key ,
206+ "block_id" : self .collection .collection_code ,
207207 "usage_key" : str (self .collection_key ),
208208 "type" : "collection" ,
209209 "display_name" : "my_collection" ,
@@ -706,7 +706,7 @@ def test_index_library_block_and_collections(self, mock_meilisearch) -> None:
706706 for collection in (collection2 , collection1 ):
707707 library_api .update_library_collection_items (
708708 self .library .key ,
709- collection_key = collection .key ,
709+ collection_key = collection .collection_code ,
710710 opaque_keys = [
711711 self .problem1 .usage_key ,
712712 ],
@@ -888,7 +888,7 @@ def test_delete_collection(self, mock_meilisearch) -> None:
888888 with freeze_time (updated_date ):
889889 library_api .update_library_collection_items (
890890 self .library .key ,
891- collection_key = self .collection .key ,
891+ collection_key = self .collection .collection_code ,
892892 opaque_keys = [
893893 self .problem1 .usage_key ,
894894 self .unit .container_key
@@ -902,14 +902,14 @@ def test_delete_collection(self, mock_meilisearch) -> None:
902902 "id" : self .doc_problem1 ["id" ],
903903 "collections" : {
904904 "display_name" : [self .collection .title ],
905- "key" : [self .collection .key ],
905+ "key" : [self .collection .collection_code ],
906906 },
907907 }
908908 doc_unit_with_collection = {
909909 "id" : self .unit_dict ["id" ],
910910 "collections" : {
911911 "display_name" : [self .collection .title ],
912- "key" : [self .collection .key ],
912+ "key" : [self .collection .collection_code ],
913913 },
914914 }
915915
@@ -928,7 +928,7 @@ def test_delete_collection(self, mock_meilisearch) -> None:
928928 # Soft-delete the collection
929929 content_api .delete_collection (
930930 self .collection .learning_package_id ,
931- self .collection .key ,
931+ self .collection .collection_code ,
932932 )
933933
934934 doc_problem_without_collection = {
@@ -963,7 +963,7 @@ def test_delete_collection(self, mock_meilisearch) -> None:
963963 with freeze_time (restored_date ):
964964 content_api .restore_collection (
965965 self .collection .learning_package_id ,
966- self .collection .key ,
966+ self .collection .collection_code ,
967967 )
968968
969969 doc_collection = copy .deepcopy (self .collection_dict )
@@ -985,7 +985,7 @@ def test_delete_collection(self, mock_meilisearch) -> None:
985985 # Hard-delete the collection
986986 content_api .delete_collection (
987987 self .collection .learning_package_id ,
988- self .collection .key ,
988+ self .collection .collection_code ,
989989 hard_delete = True ,
990990 )
991991
0 commit comments