File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
openedx_learning/apps/authoring
tests/openedx_learning/apps/authoring/units Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -481,6 +481,8 @@ def get_entities_in_published_container(
481
481
cev = container .container_entity .versioning .published
482
482
elif isinstance (container , ContainerEntity ):
483
483
cev = container .versioning .published
484
+ else :
485
+ raise TypeError (f"Expected ContainerEntity or ContainerEntityMixin; got { type (container )} " )
484
486
if cev == None :
485
487
return None # There is no published version of this container. Should this be an exception?
486
488
assert isinstance (cev , ContainerEntityVersion )
Original file line number Diff line number Diff line change @@ -236,14 +236,14 @@ def get_components_in_draft_unit(
236
236
237
237
238
238
def get_components_in_published_unit (
239
- unit : Unit | UnitVersion ,
239
+ unit : Unit ,
240
240
) -> list [UnitListEntry ]:
241
241
"""
242
242
[ 🛑 UNSTABLE ]
243
243
Get the list of entities and their versions in the draft version of the
244
244
given container.
245
245
"""
246
- assert isinstance (unit , ( Unit , UnitVersion ) )
246
+ assert isinstance (unit , Unit )
247
247
published_entities = container_api .get_entities_in_published_container (unit )
248
248
if published_entities == None :
249
249
return None # There is no published version of this unit. Should this be an exception?
Original file line number Diff line number Diff line change @@ -276,7 +276,6 @@ def test_modify_pinned_component(self):
276
276
assert authoring_api .get_components_in_draft_unit (unit ) == expected_unit_contents
277
277
assert authoring_api .get_components_in_published_unit (unit ) == expected_unit_contents
278
278
279
-
280
279
def test_query_count_of_contains_unpublished_changes (self ):
281
280
"""
282
281
Checking for unpublished changes in a unit should require a fixed number
@@ -319,7 +318,6 @@ def test_query_count_of_contains_unpublished_changes(self):
319
318
# Test viewing old snapshots of units and components by passing in a timestamp (or PublishLog PK) to a
320
319
# get_historic_unit() API?
321
320
322
-
323
321
def test_next_version_with_different_different_title (self ):
324
322
"""Test creating a unit version with a different title.
325
323
You can’t perform that action at this time.
0 commit comments