Ejemplo n.º 1
0
 def test_skype_validator(self):
     # space
     user = CtsUserFactory(skype='aaa aaa')
     with self.assertRaises(ValidationError):
         user.full_clean()
     # starts with non-letter
     user.skype = '$asdfasdf'
     with self.assertRaises(ValidationError):
         user.full_clean()
     # < 5 chars
     user.skype = 'asdff'
     with self.assertRaises(ValidationError):
         user.full_clean()
     # > 32 chars
     user.skype = ''.join(random.choice(string.lowercase) for i in range(33))
     with self.assertRaises(ValidationError):
         user.full_clean()
     user.skype = ''.join(random.choice(string.lowercase) for i in range(10))
     user.full_clean()
Ejemplo n.º 2
0
 def test_skype_validator(self):
     # space
     user = CtsUserFactory(skype='aaa aaa')
     with self.assertRaises(ValidationError):
         user.full_clean()
     # starts with non-letter
     user.skype = '$asdfasdf'
     with self.assertRaises(ValidationError):
         user.full_clean()
     # < 5 chars
     user.skype = 'asdff'
     with self.assertRaises(ValidationError):
         user.full_clean()
     # > 32 chars
     user.skype = ''.join(
         random.choice(string.lowercase) for i in range(33))
     with self.assertRaises(ValidationError):
         user.full_clean()
     user.skype = ''.join(
         random.choice(string.lowercase) for i in range(10))
     user.full_clean()