Example #1
0
    def test_should_strip_value(self):
        string_field = StringField(trim=True)

        result = string_field.clean(request=None, value=' asd ')

        assert result == 'asd'
Example #2
0
    def test_should_strip_value_for_given_characters(self):
        string_field = StringField(trim=' ')

        result = string_field.clean(request=None, value=' asd ')

        assert result == 'asd'
Example #3
0
    def test_should_not_strip_value(self):
        string_field = StringField()

        result = string_field.clean(request=None, value=" asd ")

        assert result == ' asd '