コード例 #1
0
ファイル: test_forms.py プロジェクト: akatsoulas/oneanddone
 def test_validation_missing_stage(self):
     """
     The form is invalid if the stage is not set.
     """
     form = PreviewConfirmationForm(data={'nonsense': ''})
     self.assertFalse(form.is_valid())
     eq_(form.non_field_errors(),
         ['Form data is missing or has been tampered.'])
コード例 #2
0
 def test_validation_missing_stage(self):
     """
     The form is invalid if the stage is not set.
     """
     form = PreviewConfirmationForm(data={'nonsense': ''})
     self.assertFalse(form.is_valid())
     eq_(form.non_field_errors(),
         ['Form data is missing or has been tampered.'])
コード例 #3
0
ファイル: test_forms.py プロジェクト: akatsoulas/oneanddone
 def test_validation_invalid_stage(self):
     """
     The form is invalid if the stage is not 'preview', 'confirm' or 'fill'.
     """
     form = PreviewConfirmationForm(data={'stage': 'hug_kitten'})
     self.assertFalse(form.is_valid())
     eq_(form.non_field_errors(),
         ['Form data is missing or has been tampered.'])
コード例 #4
0
 def test_validation_invalid_stage(self):
     """
     The form is invalid if the stage is not 'preview', 'confirm' or 'fill'.
     """
     form = PreviewConfirmationForm(data={'stage': 'hug_kitten'})
     self.assertFalse(form.is_valid())
     eq_(form.non_field_errors(),
         ['Form data is missing or has been tampered.'])