def test_username_validator_invalid_username(self): username = '******' self.assertFalse(username_validator(username))
def test_valid_username(self): username_validator('abcde234')
def test_username_validator_valid_username(self): username = '******' self.assertTrue(username_validator(username))
def test_not_alphanumeric_username(self): with pytest.raises(ValidationError): username_validator('hdfg#@$*&((@')
def test_too_short_username(self): with pytest.raises(ValidationError): username_validator('a')
def test_too_long_username(self): with pytest.raises(ValidationError): username_validator('a' * 16)
def test_short_username(self): username_validator('a' * 3)
def test_long_username(self): username_validator('a' * 15)