@@ -57,15 +57,13 @@ def test_create_empty_unit_and_version(self):
5757 assert unit .versioning .published is None
5858
5959 def test_create_next_unit_version_with_two_components (self ):
60- """Test creating a unit version with two components.
60+ """Test creating a unit version with two unpinned components.
6161
6262 Expected results:
6363 1. A new unit version is created.
6464 2. The unit version number is 2.
6565 3. The unit version is in the unit's versions.
66- 4. The components are in the unit version's user defined list.
67- 5. Initial list contains the pinned versions of the defined list.
68- 6. Frozen list is empty.
66+ 4. The components are in the draft unit version's component list and are unpinned.
6967 """
7068 unit , unit_version = authoring_api .create_unit_and_version (
7169 learning_package_id = self .learning_package .id ,
@@ -77,11 +75,7 @@ def test_create_next_unit_version_with_two_components(self):
7775 unit_version_v2 = authoring_api .create_next_unit_version (
7876 unit = unit ,
7977 title = "Unit" ,
80- publishable_entities_pks = [
81- self .component_1 .publishable_entity .id ,
82- self .component_2 .publishable_entity .id ,
83- ],
84- entity_version_pks = [None , None ],
78+ components = [self .component_1 , self .component_2 ],
8579 created = self .now ,
8680 created_by = None ,
8781 )
@@ -118,10 +112,7 @@ def test_add_component_after_publish(self):
118112 unit_version_v2 = authoring_api .create_next_unit_version (
119113 unit = unit ,
120114 title = unit_version .title ,
121- publishable_entities_pks = [
122- self .component_1 .publishable_entity .id ,
123- ],
124- entity_version_pks = [None ],
115+ components = [self .component_1 ],
125116 created = self .now ,
126117 created_by = None ,
127118 )
@@ -152,10 +143,7 @@ def test_modify_component_after_publish(self):
152143 unit_version_v2 = authoring_api .create_next_unit_version (
153144 unit = unit ,
154145 title = unit_version .title ,
155- publishable_entities_pks = [
156- self .component_1 .publishable_entity .id ,
157- ],
158- entity_version_pks = [None ],
146+ components = [self .component_1 ],
159147 created = self .now ,
160148 created_by = None ,
161149 )
@@ -216,7 +204,7 @@ def test_query_count_of_contains_unpublished_changes(self):
216204 )
217205 # Add 100 components (unpinned)
218206 component_count = 100
219- publishable_entities_pks = []
207+ components = []
220208 for i in range (0 , component_count ):
221209 component , _version = authoring_api .create_component_and_version (
222210 self .learning_package .id ,
@@ -225,12 +213,11 @@ def test_query_count_of_contains_unpublished_changes(self):
225213 title = f"Querying Counting Problem { i } " ,
226214 created = self .now ,
227215 )
228- publishable_entities_pks .append (component . publishable_entity_id )
216+ components .append (component )
229217 authoring_api .create_next_unit_version (
230218 unit = unit ,
231219 title = unit_version .title ,
232- publishable_entities_pks = publishable_entities_pks ,
233- entity_version_pks = [None ] * component_count ,
220+ components = components ,
234221 created = self .now ,
235222 )
236223 authoring_api .publish_all_drafts (self .learning_package .id )
0 commit comments