@@ -25,7 +25,7 @@ def setUp(self):
2525 @patch ("openedx_learning.apps.authoring.backup_restore.management.commands.lp_load.load_dump_zip_file" )
2626 def test_restore_command (self , mock_load_dump_zip_file ):
2727 # Mock load_dump_zip_file to return our in-memory zip file
28- mock_load_dump_zip_file .return_value = LearningPackageUnzipper ().load (self . zip_file )
28+ mock_load_dump_zip_file .return_value = LearningPackageUnzipper (self . zip_file ).load ()
2929
3030 out = StringIO ()
3131 # You can pass any dummy path, since load_dump_zip_file is mocked
@@ -56,17 +56,17 @@ def verify_containers(self, lp):
5656 if container .key == "unit1-b7eafb" :
5757 assert getattr (container , 'unit' , None ) is not None
5858 assert draft_version is not None
59- assert draft_version .version_num == 1
59+ assert draft_version .version_num == 2
6060 assert published_version is None
6161 elif container .key == "subsection1-48afa3" :
6262 assert getattr (container , 'subsection' , None ) is not None
6363 assert draft_version is not None
64- assert draft_version .version_num == 1
64+ assert draft_version .version_num == 2
6565 assert published_version is None
6666 elif container .key == "section1-8ca126" :
6767 assert getattr (container , 'section' , None ) is not None
6868 assert draft_version is not None
69- assert draft_version .version_num == 1
69+ assert draft_version .version_num == 2
7070 assert published_version is None
7171 else :
7272 assert False , f"Unexpected container key: { container .key } "
@@ -90,26 +90,26 @@ def verify_components(self, lp):
9090 assert component .component_type .name == "drag-and-drop-v2"
9191 assert component .component_type .namespace == "xblock.v1"
9292 assert draft_version is not None
93- assert draft_version .version_num == 1
93+ assert draft_version .version_num == 2
9494 assert published_version is None
9595 elif component .key == "xblock.v1:html:e32d5479-9492-41f6-9222-550a7346bc37" :
9696 assert component .component_type .name == "html"
9797 assert component .component_type .namespace == "xblock.v1"
9898 assert draft_version is not None
99- assert draft_version .version_num == 2
99+ assert draft_version .version_num == 5
100100 assert published_version is not None
101- assert published_version .version_num == 1
101+ assert published_version .version_num == 4
102102 elif component .key == "xblock.v1:openassessment:1ee38208-a585-4455-a27e-4930aa541f53" :
103103 assert component .component_type .name == "openassessment"
104104 assert component .component_type .namespace == "xblock.v1"
105105 assert draft_version is not None
106- assert draft_version .version_num == 1
106+ assert draft_version .version_num == 2
107107 assert published_version is None
108108 elif component .key == "xblock.v1:problem:256739e8-c2df-4ced-bd10-8156f6cfa90b" :
109109 assert component .component_type .name == "problem"
110110 assert component .component_type .namespace == "xblock.v1"
111111 assert draft_version is not None
112- assert draft_version .version_num == 1
112+ assert draft_version .version_num == 2
113113 assert published_version is None
114114 elif component .key == "xblock.v1:survey:6681da3f-b056-4c6e-a8f9-040967907471" :
115115 assert component .component_type .name == "survey"
@@ -121,7 +121,7 @@ def verify_components(self, lp):
121121 assert component .component_type .name == "video"
122122 assert component .component_type .namespace == "xblock.v1"
123123 assert draft_version is not None
124- assert draft_version .version_num == 1
124+ assert draft_version .version_num == 3
125125 assert published_version is None
126126 else :
127127 assert False , f"Unexpected component key: { component .key } "
0 commit comments