@@ -637,7 +637,6 @@ def test_set_collections(self):
637637 modified_time = datetime (2024 , 8 , 8 , tzinfo = timezone .utc )
638638 with freeze_time (modified_time ):
639639 api .set_collections (
640- self .learning_package .id ,
641640 self .draft_component .publishable_entity ,
642641 collection_qset = Collection .objects .filter (id__in = [
643642 self .collection1 .pk ,
@@ -675,7 +674,6 @@ def test_set_collections(self):
675674 new_modified_time = datetime (2024 , 8 , 8 , tzinfo = timezone .utc )
676675 with freeze_time (new_modified_time ):
677676 api .set_collections (
678- self .learning_package .id ,
679677 self .draft_component .publishable_entity ,
680678 collection_qset = Collection .objects .filter (id__in = [
681679 self .collection3 .pk ,
@@ -708,13 +706,20 @@ def test_set_collection_wrong_learning_package(self):
708706 key = "ComponentTestCase-test-key-3" ,
709707 title = "Components Test Case Learning Package-3" ,
710708 )
709+ collection = api .create_collection (
710+ learning_package_3 .id ,
711+ key = "MYCOL" ,
712+ title = "My Collection" ,
713+ created_by = None ,
714+ description = "Description of Collection" ,
715+ )
716+
711717
712718 with self .assertRaises (ValidationError ):
713719 api .set_collections (
714- learning_package_3 .id ,
715720 self .draft_component .publishable_entity ,
716721 collection_qset = Collection .objects .filter (id__in = [
717- self . collection1 .pk ,
722+ collection .pk ,
718723 ]),
719724 created_by = self .user .id ,
720725 )
0 commit comments