def test_passthrough_context():
 form = SampleForm()
 form.helper = FormHelper()
 form.helper.template = u'custom_form_template_with_context.html'
 c = {u'prefix': u'foo', u'suffix': u'bar'}
 html = render_crispy_form(form, helper=form.helper, context=c)
 assert (u'Got prefix: foo' in html)
 assert (u'Got suffix: bar' in html)

def test_passthrough_context ( ) : form = SampleForm ( ) form . helper = FormHelper ( ) form . helper . template = u'custom_form_template_with_context.html' c = { u'prefix' : u'foo' , u'suffix' : u'bar' } html = render_crispy_form ( form , helper = form . helper , context = c ) assert ( u'Got prefix: foo' in html ) assert ( u'Got suffix: bar' in html )
test to ensure that context is passed through implicitly from outside of the crispy form into the crispy form templates .