Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_initialisable_with_millisecond_precision(self):
Timestamp.from_string('2019-01-01T12:00:00.00Z')
def test_initialisable_with_microsecond_precision(self):
Timestamp.from_string('2019-01-01T12:00:00.000000Z')
def test_timestamp_in_dataclass(self):
@dataclass(repr=False)
class C(Model):
v: Timestamp
c = C(Timestamp.from_string('2019-01-01T12:00:00Z'))
assert isinstance(c.asbuiltin()['v'], str)
assert c.json() == '{"v": "2019-01-01T12:00:00Z"}'
def test_timestamp_initialisable_from_string(self):
Timestamp.from_string('2019-01-01T12:00:00Z')
def __post_init__(self):
self.added_at = Timestamp.from_string(self.added_at)
self.track = FullTrack(**self.track)