@@ -57,15 +57,13 @@ def test_create_empty_unit_and_version(self):
57
57
assert unit .versioning .published is None
58
58
59
59
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.
61
61
62
62
Expected results:
63
63
1. A new unit version is created.
64
64
2. The unit version number is 2.
65
65
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.
69
67
"""
70
68
unit , unit_version = authoring_api .create_unit_and_version (
71
69
learning_package_id = self .learning_package .id ,
@@ -77,11 +75,7 @@ def test_create_next_unit_version_with_two_components(self):
77
75
unit_version_v2 = authoring_api .create_next_unit_version (
78
76
unit = unit ,
79
77
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 ],
85
79
created = self .now ,
86
80
created_by = None ,
87
81
)
@@ -118,10 +112,7 @@ def test_add_component_after_publish(self):
118
112
unit_version_v2 = authoring_api .create_next_unit_version (
119
113
unit = unit ,
120
114
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 ],
125
116
created = self .now ,
126
117
created_by = None ,
127
118
)
@@ -152,10 +143,7 @@ def test_modify_component_after_publish(self):
152
143
unit_version_v2 = authoring_api .create_next_unit_version (
153
144
unit = unit ,
154
145
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 ],
159
147
created = self .now ,
160
148
created_by = None ,
161
149
)
@@ -216,7 +204,7 @@ def test_query_count_of_contains_unpublished_changes(self):
216
204
)
217
205
# Add 100 components (unpinned)
218
206
component_count = 100
219
- publishable_entities_pks = []
207
+ components = []
220
208
for i in range (0 , component_count ):
221
209
component , _version = authoring_api .create_component_and_version (
222
210
self .learning_package .id ,
@@ -225,12 +213,11 @@ def test_query_count_of_contains_unpublished_changes(self):
225
213
title = f"Querying Counting Problem { i } " ,
226
214
created = self .now ,
227
215
)
228
- publishable_entities_pks .append (component . publishable_entity_id )
216
+ components .append (component )
229
217
authoring_api .create_next_unit_version (
230
218
unit = unit ,
231
219
title = unit_version .title ,
232
- publishable_entities_pks = publishable_entities_pks ,
233
- entity_version_pks = [None ] * component_count ,
220
+ components = components ,
234
221
created = self .now ,
235
222
)
236
223
authoring_api .publish_all_drafts (self .learning_package .id )
0 commit comments