@@ -298,6 +298,7 @@ def test_html_library_block(self):
298
298
"taxonomy" : ["Difficulty" ],
299
299
"level0" : ["Difficulty > Normal" ],
300
300
},
301
+ "publish_status" : "never" ,
301
302
}
302
303
303
304
def test_html_published_library_block (self ):
@@ -337,6 +338,7 @@ def test_html_published_library_block(self):
337
338
"level0" : ["Difficulty > Normal" ],
338
339
},
339
340
'published' : {'display_name' : 'Text' },
341
+ "publish_status" : "published" ,
340
342
}
341
343
342
344
# Update library block to create a draft
@@ -378,6 +380,7 @@ def test_html_published_library_block(self):
378
380
"level0" : ["Difficulty > Normal" ],
379
381
},
380
382
"published" : {"display_name" : "Text" },
383
+ "publish_status" : "published" ,
381
384
}
382
385
383
386
# Publish new changes
@@ -420,8 +423,22 @@ def test_html_published_library_block(self):
420
423
"display_name" : "Text 2" ,
421
424
"description" : "This is a Test" ,
422
425
},
426
+ "publish_status" : "published" ,
423
427
}
424
428
429
+ # Verify publish status is set to modified
430
+ old_modified = self .library_block .modified
431
+ old_published = self .library_block .last_published
432
+ self .library_block .modified = datetime (2024 , 4 , 5 , 6 , 7 , 8 , tzinfo = timezone .utc )
433
+ self .library_block .last_published = datetime (2023 , 4 , 5 , 6 , 7 , 8 , tzinfo = timezone .utc )
434
+ doc = searchable_doc_for_library_block (self .library_block )
435
+ doc .update (searchable_doc_tags (self .library_block .usage_key ))
436
+ doc .update (searchable_doc_collections (self .library_block .usage_key ))
437
+ assert doc ["publish_status" ] == "modified"
438
+
439
+ self .library_block .modified = old_modified
440
+ self .library_block .last_published = old_published
441
+
425
442
def test_collection_with_library (self ):
426
443
doc = searchable_doc_for_collection (self .library .key , self .collection .key )
427
444
doc .update (searchable_doc_tags_for_collection (self .library .key , self .collection .key ))
0 commit comments