Пример #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)