#NEWLINE# def test_inputs( settings ) : #NEWLINE# #INDENT# form_helper = FormHelper ( ) #NEWLINE# form_helper . add_input ( Submit ( 'my-submit' , 'Submit' , css_class = 'button white' ) ) #NEWLINE# form_helper . add_input ( Reset ( 'my-reset' , 'Reset' ) ) #NEWLINE# form_helper . add_input ( Hidden ( 'my-hidden' , 'Hidden' ) ) #NEWLINE# form_helper . add_input ( Button ( 'my-button' , 'Button' ) ) #NEWLINE# template = get_template_from_string ( '\n        {% load crispy_forms_tags %}\n        {% crispy form form_helper %}\n    ' ) #NEWLINE# c = Context ( { #NEWLINE# #INDENT# 'form' : TestForm ( ) , #NEWLINE# 'form_helper' : form_helper , #NEWLINE# #UNINDENT# } ) #NEWLINE# html = template . render ( c ) #NEWLINE# assert ( 'button white' in html ) #NEWLINE# assert ( 'id="submit-id-my-submit"' in html ) #NEWLINE# assert ( 'id="reset-id-my-reset"' in html ) #NEWLINE# assert ( 'name="my-hidden"' in html ) #NEWLINE# assert ( 'id="button-id-my-button"' in html ) #NEWLINE# if ( settings . CRISPY_TEMPLATE_PACK == 'uni_form' ) : #NEWLINE# #INDENT# assert ( 'submit submitButton' in html ) #NEWLINE# assert ( 'reset resetButton' in form_helper ) #NEWLINE# assert ( 'class="button"' in html ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( 'class="btn"' in html ) #NEWLINE# assert ( 'btn btn-primary' in html ) #NEWLINE# assert ( 'btn btn-inverse' in html ) #NEWLINE# assert ( len ( re . findall ( '<input[^>]+> <' , html ) ) == 8 )