Tests encoding a datetime object
(self)
| 33 | assert self.encoder.default(d) == float(d) |
| 34 | |
| 35 | def test_encode_datetime(self): |
| 36 | """ |
| 37 | Tests encoding a datetime object |
| 38 | """ |
| 39 | current_time = datetime.now() |
| 40 | assert self.encoder.default(current_time) == current_time.isoformat() |
| 41 | current_time_utc = current_time.replace(tzinfo=utc) |
| 42 | assert self.encoder.default(current_time_utc) == current_time.isoformat() + 'Z' |
| 43 | |
| 44 | def test_encode_time(self): |
| 45 | """ |