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

Method test_encode_decimal

tests/test_encoders.py:28–33  ·  view source on GitHub ↗

Tests encoding a decimal

(self)

Source from the content-addressed store, hash-verified

26 self.encoder = JSONEncoder()
27
28 def test_encode_decimal(self):
29 """
30 Tests encoding a decimal
31 """
32 d = Decimal(3.14)
33 assert self.encoder.default(d) == float(d)
34
35 def test_encode_datetime(self):
36 """

Callers

nothing calls this directly

Calls 1

defaultMethod · 0.80

Tested by

no test coverage detected