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

Method test_encode_time_tz

tests/test_encoders.py:51–58  ·  view source on GitHub ↗

Tests encoding a timezone aware timestamp

(self)

Source from the content-addressed store, hash-verified

49 assert self.encoder.default(current_time) == current_time.isoformat()
50
51 def test_encode_time_tz(self):
52 """
53 Tests encoding a timezone aware timestamp
54 """
55 current_time = datetime.now().time()
56 current_time = current_time.replace(tzinfo=utc)
57 with pytest.raises(ValueError):
58 self.encoder.default(current_time)
59
60 def test_encode_date(self):
61 """

Callers

nothing calls this directly

Calls 1

defaultMethod · 0.80

Tested by

no test coverage detected