def validate_directory(path): if not validate_directory(path): return ValidationError(_("'%s is not a valid path.'") % path)
def test_validate_directory(self): self.failUnless(validate_directory("/home")) self.failUnless(validate_directory("~")) self.failIf(validate_int("~/SomeFolderNoOneWouldHabe")) self.failIf(validate_int("/SomeFolderSystemDoesntHave"))
def test_validate_directory(self): self.assertTrue(validate_directory("/home")) self.assertTrue(validate_directory("~")) self.assertFalse(validate_int("~/SomeFolderNoOneWouldHabe")) self.assertFalse(validate_int("/SomeFolderSystemDoesntHave"))