MCPcopy Index your code
hub / github.com/encode/django-rest-framework / test_encode_timedelta

Method test_encode_timedelta

tests/test_encoders.py:67–72  ·  view source on GitHub ↗

Tests encoding a timedelta object

(self)

Source from the content-addressed store, hash-verified

65 assert self.encoder.default(current_date) == current_date.isoformat()
66
67 def test_encode_timedelta(self):
68 """
69 Tests encoding a timedelta object
70 """
71 delta = timedelta(hours=1)
72 assert self.encoder.default(delta) == str(delta.total_seconds())
73
74 def test_encode_uuid(self):
75 """

Callers

nothing calls this directly

Calls 1

defaultMethod · 0.80

Tested by

no test coverage detected