def setUp(self):
     super(TestDateTime, self).setUp()
     self.dt = datetime.datetime(1955, 11, 5, tzinfo=iso8601.iso8601.Utc())
     self.field = fields.DateTimeField()
     self.coerce_good_values = [(self.dt, self.dt),
                                (_utils.isotime(self.dt), self.dt)]
     self.coerce_bad_values = [1, 'foo']
     self.to_primitive_values = [(self.dt, _utils.isotime(self.dt))]
     self.from_primitive_values = [(_utils.isotime(self.dt), self.dt)]
 def setUp(self):
     super(TestDateTimeNoTzinfo, self).setUp()
     self.dt = datetime.datetime(1955, 11, 5)
     self.field = fields.DateTimeField(tzinfo_aware=False)
     self.coerce_good_values = [(self.dt, self.dt),
                                (_utils.isotime(self.dt), self.dt)]
     self.coerce_bad_values = [1, 'foo']
     self.to_primitive_values = [(self.dt, _utils.isotime(self.dt))]
     self.from_primitive_values = [(
         _utils.isotime(self.dt),
         self.dt,
     )]
 def setUp(self):
     super(TestDateTimeNoTzinfo, self).setUp()
     self.dt = datetime.datetime(1955, 11, 5)
     self.field = fields.DateTimeField(tzinfo_aware=False)
     self.coerce_good_values = [(self.dt, self.dt),
                                (_utils.isotime(self.dt), self.dt)]
     self.coerce_bad_values = [1, 'foo']
     self.to_primitive_values = [(self.dt, _utils.isotime(self.dt))]
     self.from_primitive_values = [
         (
             _utils.isotime(self.dt),
             self.dt,
         )
     ]
示例#4
0
 def stringify(value):
     return _utils.isotime(value)
示例#5
0
 def to_primitive(obj, attr, value):
     return _utils.isotime(value)
 def stringify(value):
     return _utils.isotime(value)
 def to_primitive(obj, attr, value):
     return _utils.isotime(value)