Пример #1
0
 def test_validate_exclusion_malformed(self):
     validations.validate_exclusion(self.model, "color", bad=[])
Пример #2
0
    def test_validate_exclusion_invalid(self):
        validations.validate_exclusion(self.model, "color", choices=["red", "orange", "yellow"])

        assert_bad_color(self.model)
Пример #3
0
    def test_validate_exclusion_on_missing_attribute(self):
        validations.validate_exclusion(self.model, "missing", choices=range(5))

        assert_equals(0, len(self.model.errors))
Пример #4
0
    def test_validate_exclusion_valid(self):
        validations.validate_exclusion(self.model, "color", choices=["blue", "indigo", "violet"])

        assert_good_color(self.model)