Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)

src/w/t/wtforms-HEAD/tests/validators.py   wtforms(Download)
)
from functools import partial
from tests.common import DummyField, grab_error_message, grab_stop_message
 
 
 
        # Check message and custom message
        grab = lambda **k: grab_stop_message(data_required(**k), self.form, DummyField(''))
        self.assertEqual(grab(), 'This field is required.')
        self.assertEqual(grab(message='foo'), 'foo')
 
        # Check message and custom message
        grab = lambda **k: grab_stop_message(input_required(**k), self.form, DummyField('', raw_data=['']))
        self.assertEqual(grab(), 'This field is required.')
        self.assertEqual(grab(message='foo'), 'foo')