From b34b53287fe8b82dbcb19e587caf01fc3f29a374 Mon Sep 17 00:00:00 2001 From: Nikita Krasnov Date: Wed, 30 Aug 2017 12:20:06 +0400 Subject: [PATCH] Format UUID was set the same for DBRef, UUID into__id and UUID into document --- mongo_connector/doc_managers/formatters.py | 2 +- tests/test_formatters.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mongo_connector/doc_managers/formatters.py b/mongo_connector/doc_managers/formatters.py index d5d6fca1..97874629 100644 --- a/mongo_connector/doc_managers/formatters.py +++ b/mongo_connector/doc_managers/formatters.py @@ -87,7 +87,7 @@ def transform_value(self, value): # Just include body of binary data without subtype return base64.b64encode(value).decode() elif isinstance(value, UUID): - return value.hex + return value elif isinstance(value, (int, long, float)): if isnan(value): raise ValueError("nan") diff --git a/tests/test_formatters.py b/tests/test_formatters.py index 64c5d3a7..5b85a922 100644 --- a/tests/test_formatters.py +++ b/tests/test_formatters.py @@ -65,7 +65,7 @@ def test_types(self): self.assertEqual(trans(self.date), self.date) # UUID - self.assertEqual(trans(self.xuuid), self.xuuid.hex) + self.assertEqual(trans(self.xuuid), self.xuuid) # Other type self.assertEqual(trans(self.oid), str(self.oid))