def test_panel_readonly_html_attr(self):
     """Test if we set the proper HTML attr when passing a 'readonly' kwarg to the form_field_row panel"""
     fieldrow = form_field_row(None,
                               self.request,
                               self.form.description,
                               readonly='readonly')
     self.assertTrue('readonly' in fieldrow.get('html_attrs').keys())
 def test_description_field_html_attrs(self):
     """Test if required fields pass the proper HTML attributes to the form_field_row panel"""
     fieldrow = form_field_row(None, self.request, self.form.description)
     self.assertTrue(hasattr(self.form.name.flags, 'required'))
     self.assertTrue('required' in fieldrow.get('html_attrs').keys())
     self.assertTrue(
         fieldrow.get('html_attrs').get('maxlength') is not None)
 def test_name_field_html_attrs(self):
     """Test if required fields pass the proper HTML attributes to the form_field_row panel"""
     fieldrow = form_field_row(None, self.request, self.form.name)
     self.assertTrue(hasattr(self.form.name.flags, 'required'))
     self.assertTrue('required' in fieldrow.get('html_attrs').keys())
     self.assertTrue(fieldrow.get('html_attrs').get('maxlength') is None)
Exemple #4
0
 def test_panel_readonly_html_attr(self):
     """Test if we set the proper HTML attr when passing a 'readonly' kwarg to the form_field_row panel"""
     fieldrow = form_field_row(None, self.request, self.form.description, readonly="readonly")
     self.assertTrue("readonly" in fieldrow.get("html_attrs").keys())
Exemple #5
0
 def test_instand_id_field_html_attrs(self):
     """Test if required fields pass the proper HTML attributes to the form_field_row panel"""
     fieldrow = form_field_row(None, self.request, self.form.instance_id)
     self.assertTrue(hasattr(self.form.instance_id.flags, 'required'))
     self.assertTrue('required' in fieldrow.get('html_attrs').keys())
     self.assertTrue(fieldrow.get('html_attrs').get('maxlength') is None)
Exemple #6
0
 def test_name_field_html_attrs(self):
     """Test if required fields pass the proper HTML attributes to the form_field_row panel"""
     fieldrow = form_field_row(None, self.request, self.form.name)
     self.assertTrue(hasattr(self.form.name.flags, "required"))
     self.assertTrue("required" in fieldrow.get("html_attrs").keys())
     self.assertTrue(fieldrow.get("html_attrs").get("maxlength") is not None)