예제 #1
0
 def test_username_validator_invalid_username(self):
     username = '******'
     self.assertFalse(username_validator(username))
예제 #2
0
 def test_valid_username(self):
     username_validator('abcde234')
예제 #3
0
 def test_username_validator_valid_username(self):
     username = '******'
     self.assertTrue(username_validator(username))
예제 #4
0
 def test_not_alphanumeric_username(self):
     with pytest.raises(ValidationError):
         username_validator('hdfg#@$*&((@')
예제 #5
0
 def test_too_short_username(self):
     with pytest.raises(ValidationError):
         username_validator('a')
예제 #6
0
 def test_too_long_username(self):
     with pytest.raises(ValidationError):
         username_validator('a' * 16)
예제 #7
0
 def test_short_username(self):
     username_validator('a' * 3)
예제 #8
0
 def test_long_username(self):
     username_validator('a' * 15)