Example #1
0
 def test_short_input(self):
     f = fields.PasswordField('')
     password = '******'
     self.assertRaises(exceptions.ValidationError, f.run_validators,
                       password)
Example #2
0
 def test_valid_input(self):
     f = fields.PasswordField('')
     for char in f.special_characters:
         if char != '\\':
             password = '******' + char
             self.assertIsNone(f.run_validators(password))
Example #3
0
 def test_input_without_special_characters(self):
     f = fields.PasswordField('')
     password = '******'
     self.assertRaises(exceptions.ValidationError, f.run_validators,
                       password)
Example #4
0
 def test_input_without_uppercase(self):
     f = fields.PasswordField('')
     password = '******'
     self.assertRaises(exceptions.ValidationError, f.run_validators,
                       password)
Example #5
0
 def setUp(self):
     super(TestPasswordField, self).setUp()
     self.password_field = fields.PasswordField(None)
     self.password_field.original = True
     self.password_field.required = True
     self.addCleanup(mock.patch.stopall)