def _validate_json_format(self, filter_value, schema_validation_type):
     """
     adds the type:string format:schema_validation_type
     :param filter_value: value of the filter
     :param schema_validation_type: format description of the json schema entry
     """
     ok = False
     try:
         validators.json_schema_validation_format(filter_value, schema_validation_type)
         ok = True
     except ValueError as e:
         pass
     return ok
Example #2
0
 def _validate_json_format(self,filter_value, schema_validation_type):
     """
     adds the type:string format:schema_validation_type
     :param filter_value: value of the filter
     :param schema_validation_type: format description of the json schema entry
     """
     ok = False
     try:
         validators.json_schema_validation_format(filter_value, schema_validation_type)
         ok = True
     except ValueError as e:
         pass
     return ok
 def test_json_schema_validation_datetime_pass(self):
     schema = {u'format': u'date-time'}
     self.assertEquals(None, validators.json_schema_validation_format(u"2012-12-19T00:39:49+01:00", schema));
     self.assertEquals(None, validators.json_schema_validation_format(u"2012-12-19T00:39:49", schema));