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)
def check_in_html(needle, haystack): test_case = SimpleTestCase() test_case.assertInHTML(needle, haystack) return True