Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 36b63a2

Browse files
authored
Merge pull request #243 from cloudant/242-replication-id-str
Correctly transform UUID object into a string.
2 parents b89e4f5 + f4bd99d commit 36b63a2

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGES.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
2.4.0 (Unreleased)
22
==================
3-
3+
- [FIXED] Resolved issue where generated UUIDs for replication documents would
4+
not be converted to strings.
45

56
2.3.0 (2016-11-02)
67
==================

src/cloudant/replicator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import uuid
2020

21-
from ._2to3 import unicode_
2221
from .error import CloudantException
2322
from .document import Document
2423

@@ -73,7 +72,7 @@ def create_replication(self, source_db=None, target_db=None,
7372
"""
7473

7574
data = dict(
76-
_id=repl_id if repl_id else unicode_(uuid.uuid4()),
75+
_id=repl_id if repl_id else str(uuid.uuid4()),
7776
**kwargs
7877
)
7978

tests/unit/replicator_tests.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def test_constructor_failure(self):
9898
self.assertIsNone(repl)
9999
self.client.connect()
100100

101+
def test_replication_with_generated_id(self):
102+
clone = Replicator(self.client)
103+
clone.create_replication(self.db, self.target_db)
104+
101105
def test_create_replication(self):
102106
"""
103107
Test that the replication document gets created and that the

0 commit comments

Comments
 (0)