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