File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 24
24
from bson .binary import Binary , MD5_SUBTYPE , USER_DEFINED_SUBTYPE
25
25
from bson .code import Code
26
26
from bson .codec_options import CodecOptions
27
+ from bson .decimal128 import Decimal128
27
28
from bson .dbref import DBRef
28
29
from bson .int64 import Int64
29
30
from bson .max_key import MaxKey
@@ -84,6 +85,13 @@ def test_basic(self):
84
85
def test_objectid (self ):
85
86
self .round_trip ({"id" : ObjectId ()})
86
87
88
+ def test_decimal128 (self ):
89
+ decimal_doc = {"d" : Decimal128 ("12123.000000000003" )}
90
+ self .round_trip (decimal_doc )
91
+ self .assertEqual (
92
+ '{ "d" : { "$numberDecimal" : "12123.000000000003" } }' ,
93
+ bsonjs_dumps (decimal_doc ))
94
+
87
95
def test_dbref (self ):
88
96
self .round_trip ({"ref" : DBRef ("foo" , 5 )})
89
97
self .round_trip ({"ref" : DBRef ("foo" , 5 , "db" )})
You can’t perform that action at this time.
0 commit comments