def test_validate_exclusion_malformed(self):
     validations.validate_exclusion(self.model, "color", bad=[])
    def test_validate_exclusion_invalid(self):
        validations.validate_exclusion(self.model, "color", choices=["red", "orange", "yellow"])

        assert_bad_color(self.model)
    def test_validate_exclusion_on_missing_attribute(self):
        validations.validate_exclusion(self.model, "missing", choices=range(5))

        assert_equals(0, len(self.model.errors))
    def test_validate_exclusion_valid(self):
        validations.validate_exclusion(self.model, "color", choices=["blue", "indigo", "violet"])

        assert_good_color(self.model)