107 expected % {'eid': state.eid}) |
107 expected % {'eid': state.eid}) |
108 |
108 |
109 |
109 |
110 def test_richtextfield_1(self): |
110 def test_richtextfield_1(self): |
111 self.req.use_fckeditor = lambda: False |
111 self.req.use_fckeditor = lambda: False |
112 self._test_richtextfield('''<select id="description_format:%(eid)s" name="description_format:%(eid)s" size="1" tabindex="0"> |
112 self._test_richtextfield('''<select id="description_format:%(eid)s" name="description_format:%(eid)s" size="1" style="display: block" tabindex="0"> |
113 <option value="text/cubicweb-page-template">text/cubicweb-page-template</option> |
113 <option value="text/cubicweb-page-template">text/cubicweb-page-template</option> |
114 <option value="text/html">text/html</option> |
114 <option value="text/html">text/html</option> |
115 <option value="text/plain">text/plain</option> |
115 <option value="text/plain">text/plain</option> |
116 <option selected="selected" value="text/rest">text/rest</option> |
116 <option selected="selected" value="text/rest">text/rest</option> |
117 </select><textarea cols="60" id="description:%(eid)s" name="description:%(eid)s" onkeypress="autogrow(this)" rows="5" tabindex="1"/>''') |
117 </select><textarea cols="60" id="description:%(eid)s" name="description:%(eid)s" onkeypress="autogrow(this)" rows="5" tabindex="1"/>''') |
118 |
118 |
119 |
119 |
120 def test_richtextfield_2(self): |
120 def test_richtextfield_2(self): |
121 self.req.use_fckeditor = lambda: True |
121 self.req.use_fckeditor = lambda: True |
122 self._test_richtextfield('<input name="description_format:%(eid)s" type="hidden" value="text/rest"/><textarea cols="80" cubicweb:type="wysiwyg" id="description:%(eid)s" name="description:%(eid)s" onkeypress="autogrow(this)" rows="20" tabindex="0"/>') |
122 self._test_richtextfield('<input name="description_format:%(eid)s" style="display: block" type="hidden" value="text/rest"/><textarea cols="80" cubicweb:type="wysiwyg" id="description:%(eid)s" name="description:%(eid)s" onkeypress="autogrow(this)" rows="20" tabindex="0"/>') |
123 |
123 |
124 |
124 |
125 def test_filefield(self): |
125 def test_filefield(self): |
126 class FFForm(EntityFieldsForm): |
126 class FFForm(EntityFieldsForm): |
127 data = FileField(format_field=StringField(name='data_format'), |
127 data = FileField(format_field=StringField(name='data_format'), |