@@ -46,7 +46,9 @@ class ITaggedValuesSchema(model.Schema):
4646
4747 parametrized_widget_field = schema .TextLine (title = "Parametrized widget field" )
4848 form .widget (
49- "parametrized_widget_field" , a_param = "some_value" , defaultFactory = lambda : "Foo"
49+ "parametrized_widget_field" ,
50+ a_param = "some_value" ,
51+ defaultFactory = lambda : "Foo" ,
5052 )
5153
5254 not_parametrized_widget_field = schema .TextLine (
@@ -459,7 +461,11 @@ def test_decimal(self):
459461
460462 def test_int (self ):
461463 field = schema .Int (
462- title = "My field" , description = "My great field" , min = 0 , max = 100 , default = 50
464+ title = "My field" ,
465+ description = "My great field" ,
466+ min = 0 ,
467+ max = 100 ,
468+ default = 50 ,
463469 )
464470 adapter = getMultiAdapter (
465471 (field , self .portal , self .request ), IJsonSchemaProvider
@@ -742,9 +748,33 @@ def test_richtext(self):
742748 adapter .get_schema (),
743749 )
744750
751+ def test_richtext_with_default (self ):
752+ field = RichText (
753+ title = "My field" ,
754+ description = "My great field" ,
755+ default = "<p>Some default value</p>" ,
756+ )
757+ adapter = getMultiAdapter (
758+ (field , self .portal , self .request ), IJsonSchemaProvider
759+ )
760+
761+ self .assertEqual (
762+ {
763+ "type" : "string" ,
764+ "title" : "My field" ,
765+ "factory" : "Rich Text" ,
766+ "description" : "My great field" ,
767+ "widget" : "richtext" ,
768+ "default" : "<p>Some default value</p>" ,
769+ },
770+ adapter .get_schema (),
771+ )
772+
745773 def test_date (self ):
746774 field = schema .Date (
747- title = "My field" , description = "My great field" , default = date (2016 , 1 , 1 )
775+ title = "My field" ,
776+ description = "My great field" ,
777+ default = date (2016 , 1 , 1 ),
748778 )
749779 adapter = getMultiAdapter (
750780 (field , self .portal , self .request ), IJsonSchemaProvider
@@ -781,7 +811,9 @@ def test_datetime(self):
781811
782812 def test_jsonfield (self ):
783813 field = JSONField (
784- title = "My field" , description = "My great field" , widget = "my_widget_name"
814+ title = "My field" ,
815+ description = "My great field" ,
816+ widget = "my_widget_name" ,
785817 )
786818 adapter = getMultiAdapter (
787819 (field , self .portal , self .request ), IJsonSchemaProvider
0 commit comments