示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)
示例#5
0
 def testHtmlMark_name_with_href(self):
     vm = mock_error("href", "name", "hello")
     actual = html.html_mark("*", vm)
     expected = '<a href="href" style="text-decoration:none"><span class="error" title="hello">*</span></a>'
     self.assertEqual(actual, expected)
示例#6
0
 def testHtmlMark_other(self):
     vm = mock_error("main", "", "hello")
     actual = html.html_mark("X", vm)
     expected = '<a href="main" style="text-decoration:none"><span class="error" title="hello">X</span></a>'
     self.assertEqual(actual, expected)
示例#7
0
 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)