def test_wrong_key_rejected(self, mock_add_report_data): bad_request = {'key': 'not my key'} form = SecretKeyForm(bad_request) form.report = self.report self.assertFalse(form.is_valid()) self.assertEqual( form.errors['key'], ["The passphrase didn't match."] )
def test_wrong_key_rejected(self): bad_request = {'key': 'not my key'} form = SecretKeyForm(bad_request) form.report = self.report self.assertFalse(form.is_valid()) self.assertEqual( form.errors['key'], ["The passphrase didn't match."] )
def test_right_key_accepted(self, mock_add_report_data): good_request = {'key': self.key} form = SecretKeyForm(good_request) form.report = self.report self.assertTrue(form.is_valid())