def testHtmlSelect_multi_error(self): actual = html.html_select( mock_validation(errors={"hello": mock_error(message="error")}), "hello", multi=True) expected = '<a name="" style="text-decoration:none"><span class="error" title="error">*</span></a><select name="hello" class="multi" multiple="multiple" >' self.assertEqual(actual, expected)
def testHtmlSelect_multi_onchange(self): actual = html.html_select(mock_validation(), "hello", onchange="test();", multi=True) expected = '<select name="hello" class="multi" multiple="multiple" onchange="test();">' self.assertEqual(actual, expected)
def testHtmlSelect_onfocus_onchange(self): actual = html.html_select(mock_validation(), "hello", onfocus="test1();", onchange="test2();") expected = '<select name="hello" onfocus="test1();" onchange="test2();">' self.assertEqual(actual, expected)
def testHtmlSelect_basic(self): actual = html.html_select(mock_validation(), "hello") expected = '<select name="hello">' self.assertEqual(actual, expected)
def testHtmlSelect_info(self): actual = html.html_select( mock_validation(infos={"hello": mock_error(message="info")}), "hello") expected = '<a href="" style="text-decoration:none"><span class="info" title="info">#</span></a><select name="hello">' self.assertEqual(actual, expected)
def testHtmlSelect_warning(self): actual = html.html_select( mock_validation(warnings={"hello": mock_error(message="warning")}), "hello") expected = '<a name="" style="text-decoration:none"><span class="error" title="warning">?</span></a><select name="hello">' self.assertEqual(actual, expected)