コード例 #1
0
    def test_validate_presence_invalid(self):
        self.model.color = None
        validations.validate_presence(self.model, "color")

        assert_bad_color(self.model)
コード例 #2
0
    def test_validate_presence_on_missing_attribute(self):
        self.model = ValidationModel()
        validations.validate_presence(self.model, "color")

        assert_bad_color(self.model)
コード例 #3
0
    def test_validate_presence_valid(self):
        validations.validate_presence(self.model, "color")

        assert_good_color(self.model)