def testHtmlInput_checkbox_marked_double(self): actual = html.html_input( mock_validation(errors={"hello": mock_error(message="error")}, infos={"hello": mock_error(message="info")}), "checkbox", "hello", "test_value", False) expected = '<label><a name="" style="text-decoration:none"><span class="error" title="error">*</span></a><input type="checkbox" name="hello" value="test_value"></label>' self.assertEqual(actual, expected)
def testHtmlInput_textarea_sized(self): actual = html.html_input(mock_validation(), "textarea", "hello", "test_value", False, size="42x42") expected = '<TextArea name="hello" cols="42" rows="42">test_value</TextArea>' self.assertEqual(actual, expected)
def testHtmlInput_text_sized(self): actual = html.html_input(mock_validation(), "text", "hello", "test_value", False, size="42") expected = '<input type="text" name="hello" value="test_value" size="42">' self.assertEqual(actual, expected)
def testHtmlInput_checkbox_after(self): actual = html.html_input(mock_validation(), "checkbox", "hello", "test_value", False, after="</div>") expected = '<label><input type="checkbox" name="hello" value="test_value"></div></label>' self.assertEqual(actual, expected)
def testHtmlInput_checkbox_before(self): actual = html.html_input(mock_validation(), "checkbox", "hello", "test_value", False, before="Button: ") expected = '<label>Button: <input type="checkbox" name="hello" value="test_value"></label>' self.assertEqual(actual, expected)
def testHtmlInput_checkbox_disabled(self): actual = html.html_input(mock_validation(), "checkbox", "hello", "test_value", False, disabled=True) expected = '<label><input type="checkbox" name="hello" value="test_value" disabled="disabled"></label>' self.assertEqual(actual, expected)
def testHtmlInput_radio_onclick(self): actual = html.html_input(mock_validation(), "radio", "hello", "test_value", False, onclick="helloworld();") expected = '<label><input type="radio" name="hello" value="test_value" onclick="helloworld();"></label>' self.assertEqual(actual, expected)
def testHtmlInput_radio_before_after(self): actual = html.html_input(mock_validation(), "radio", "hello", "test_value", False, before="<div>Button: ", after="</div>") expected = '<label><div>Button: <input type="radio" name="hello" value="test_value"></div></label>' self.assertEqual(actual, expected)
def testHtmlInput_hidden_basic(self): actual = html.html_input(mock_validation(), "hidden", "hello", "test_value", False) expected = '<input type="hidden" name="hello" value="test_value">' self.assertEqual(actual, expected)
def testHtmlInput_textarea_basic(self): actual = html.html_input(mock_validation(), "textarea", "hello", "test_value", False) expected = '<TextArea name="hello">test_value</TextArea>' self.assertEqual(actual, expected)
def testHtmlInput_checkbox_marked_negative(self): actual = html.html_input( mock_validation(infos={"world": mock_error(message="info")}), "checkbox", "hello", "test_value", False) expected = '<label><input type="checkbox" name="hello" value="test_value"></label>' self.assertEqual(actual, expected)
def testHtmlInput_radio_basic(self): actual = html.html_input(mock_validation(), "radio", "hello", "test_value", False) expected = '<label><input type="radio" name="hello" value="test_value"></label>' self.assertEqual(actual, expected)