Example #1
0
    def testFieldFormatters(self):  # Formatter should be called Validator

        # Test the default formatters
        for typ in ALLOWED_DATATYPES:
            f = Field('abc', typ)
            if typ not in ['date', 'time', 'datetime']:
                isinstance(f.formatter('test'), str)
            else:
                isinstance(f.formatter(datetime.datetime.now()), str)
Example #2
0
    def testFieldFormatters(self):  # Formatter should be called Validator

        # Test the default formatters
        for typ in ALLOWED_DATATYPES:
            f = Field("abc", typ)
            if typ not in ["date", "time", "datetime"]:
                isinstance(f.formatter("test"), str)
            else:
                isinstance(f.formatter(datetime.datetime.now()), str)