def test_invalid_name(self): """validate_username_available disallows unvailable names""" with self.assertRaises(ValidationError): validate_username_available(self.test_user.username)
def test_valid_name(self): """validate_username_available allows available names""" validate_username_available('BobBoberson') validate_username_available(self.test_user.username, exclude=self.test_user)