Skip to content

Commit 80ca17a

Browse files
author
Med Kamal
committed
adding unit test
1 parent 74f24a4 commit 80ca17a

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

ravendb/tests/jvm_migrated_tests/client_tests/documents_tests/commands_tests/test_put_document_command.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
from ravendb.tests.test_base import TestBase
66
from ravendb.tools.utils import Utils
77

8+
class Article:
9+
def __init__(
10+
self,
11+
Id: str = None,
12+
title: str = None,
13+
):
14+
self.Id = Id
15+
self.title = title
816

917
class TestPutDocumentCommand(TestBase):
1018
def setUp(self):
@@ -27,7 +35,7 @@ def test_can_put_document_using_command(self):
2735
loaded_user = session.load("users/1", User)
2836
self.assertEqual(loaded_user.name, "Gracjan")
2937

30-
@unittest.skip("todo: Not passing on CI/CD")
38+
# @unittest.skip("todo: Not passing on CI/CD")
3139
def test_can_put_document_using_command_with_surrogate_pairs(self):
3240
name_with_emojis = "Gracjan \ud83d\ude21\ud83d\ude21\ud83e\udd2c\ud83d\ude00😡😡🤬😀"
3341

@@ -45,3 +53,19 @@ def test_can_put_document_using_command_with_surrogate_pairs(self):
4553
with self.store.open_session() as session:
4654
loaded_user = session.load("users/2", User)
4755
self.assertEqual(loaded_user.name, name_with_emojis)
56+
57+
def test_can_put_document_using_command_with_utf_8_chars(self):
58+
title_with_emojis = "Déposer un CAPITAL SOCIAL : ce que tu dois ABSOLUMENT comprendre avant de lancer une ENTREPRISE 🏦"
59+
60+
article = Article(title=title_with_emojis)
61+
node = Utils.entity_to_dict(article, self.store.conventions.json_default_method)
62+
command = PutDocumentCommand("articles/1", None, node)
63+
self.store.get_request_executor().execute_command(command)
64+
65+
result = command.result
66+
67+
self.assertIsNotNone(result.change_vector)
68+
69+
with self.store.open_session() as session:
70+
loaded_user = session.load("articles/1", Article)
71+
self.assertEqual(loaded_user.name, title_with_emojis)

0 commit comments

Comments
 (0)