예제 #1
0
def test_formfield_rendering(value):
    class TestForm(Form):
        color = ColorField(initial=value)

    test_form = TestForm()
    html_output = test_form.as_p()
    testcase = SimpleTestCase()
    testcase.assertInHTML(
        '<input type="color" name="color" value="#{}" '
        'required id="id_color">'.format(value), html_output)
예제 #2
0
def check_in_html(needle, haystack):
    test_case = SimpleTestCase()
    test_case.assertInHTML(needle, haystack)
    return True