@@ -493,6 +493,7 @@ def test_embed__content__valid():
493493 "text" : "Resource text" ,
494494 "language" : "en" ,
495495 "content_id" : str (uuid .uuid4 ()),
496+ "channel_version" : 1 ,
496497 },
497498 ],
498499 "metadata" : {
@@ -517,6 +518,7 @@ def test_embed__content__valid_with_files():
517518 "text" : "Resource text" ,
518519 "language" : "en" ,
519520 "content_id" : str (uuid .uuid4 ()),
521+ "channel_version" : 1 ,
520522 "files" : [
521523 {
522524 "url" : "http://localhost:8000/media/1234.jpg" ,
@@ -616,6 +618,31 @@ def test_embed__content__invalid_content_id():
616618 )
617619
618620
621+ @skip_if_jsonschema_unavailable
622+ def test_embed__content__invalid_channel_version ():
623+ with pytest .raises (jsonschema .ValidationError ):
624+ _validate_embed_content_request (
625+ {
626+ "resources" : [
627+ {
628+ "id" : str (uuid .uuid4 ()),
629+ "channel_id" : str (uuid .uuid4 ()),
630+ "title" : "Resource title" ,
631+ "description" : "Resource description" ,
632+ "text" : "Resource text" ,
633+ "language" : "en" ,
634+ "content_id" : str (uuid .uuid4 ()),
635+ "channel_version" : "v1" ,
636+ },
637+ ],
638+ "metadata" : {
639+ "channel_title" : "Channel title" ,
640+ "some_additional_field" : "some_random_value" ,
641+ },
642+ }
643+ )
644+
645+
619646@skip_if_jsonschema_unavailable
620647def test_embed__content__invalid_url_files ():
621648 with pytest .raises (jsonschema .ValidationError ):
0 commit comments