コード例 #1
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())
コード例 #2
0
 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)
コード例 #3
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 None)
コード例 #4
0
ファイル: test_panels.py プロジェクト: suwaji/eucaconsole
 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())
コード例 #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)
コード例 #6
0
ファイル: test_keypairs.py プロジェクト: suwaji/eucaconsole
 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)