예제 #1
0
 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."]
     )
예제 #2
0
 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."]
     )
예제 #3
0
 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())
예제 #4
0
 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())