Example #1
0
 def test_username_pass_when_valid(self):
     try:
         validate_username('a.valid_username-123')
     except:
         self.fail('Valid username should not raise an exception')
Example #2
0
 def test_username_raises_error_when_it_contains_uppercase_letters(self):
     with self.assertRaises(ValueError):
         validate_username('INVALIDUSERNAME')
Example #3
0
 def test_username_raises_error_when_it_contains_special_characters(self):
     with self.assertRaises(ValueError):
         validate_username('invalid@username')