Esempio n. 1
0
 def test_amend_form(self):
     # textchas are disabled for 'some_locale'
     flaskg.user.profile[LOCALE] = 'some_locale'
     test_form = TextChaizedForm()
     test_form['textcha_question'].value = None
     textcha_obj = TextCha(test_form)
     # before calling amend_form
     assert not textcha_obj.form['textcha_question'].optional
     assert not textcha_obj.form['textcha'].optional
     # on calling amend_form
     textcha_obj.amend_form()
     assert textcha_obj.form['textcha_question'].optional
     assert textcha_obj.form['textcha'].optional
Esempio n. 2
0
 def test_amend_form(self):
     # textchas are disabled for 'some_locale'
     flaskg.user.profile[LOCALE] = 'some_locale'
     test_form = TextChaizedForm()
     test_form['textcha_question'].value = None
     textcha_obj = TextCha(test_form)
     # before calling amend_form
     assert not textcha_obj.form['textcha_question'].optional
     assert not textcha_obj.form['textcha'].optional
     # on calling amend_form
     textcha_obj.amend_form()
     assert textcha_obj.form['textcha_question'].optional
     assert textcha_obj.form['textcha'].optional