66from ravendb .tools .utils import Utils
77
88
9+ class Article :
10+ def __init__ (
11+ self ,
12+ Id : str = None ,
13+ title : str = None ,
14+ ):
15+ self .Id = Id
16+ self .title = title
17+
18+
919class TestPutDocumentCommand (TestBase ):
1020 def setUp (self ):
1121 super ().setUp ()
@@ -27,9 +37,9 @@ def test_can_put_document_using_command(self):
2737 loaded_user = session .load ("users/1" , User )
2838 self .assertEqual (loaded_user .name , "Gracjan" )
2939
30- @unittest .skip ("todo: Not passing on CI/CD" )
40+ # @unittest.skip("todo: Not passing on CI/CD")
3141 def test_can_put_document_using_command_with_surrogate_pairs (self ):
32- name_with_emojis = "Gracjan \ud83d \ude21 \ud83d \ude21 \ud83e \udd2c \ud83d \ude00 😡😡🤬😀"
42+ name_with_emojis = "Gracjan 😡😡🤬😀"
3343
3444 user = User (name = name_with_emojis , age = 31 )
3545 node = Utils .entity_to_dict (user , self .store .conventions .json_default_method )
@@ -45,3 +55,21 @@ def test_can_put_document_using_command_with_surrogate_pairs(self):
4555 with self .store .open_session () as session :
4656 loaded_user = session .load ("users/2" , User )
4757 self .assertEqual (loaded_user .name , name_with_emojis )
58+
59+ def test_can_put_document_using_command_with_utf_8_chars (self ):
60+ title_with_emojis = (
61+ "Déposer un CAPITAL SOCIAL : ce que tu dois ABSOLUMENT comprendre avant de lancer une ENTREPRISE 🏦"
62+ )
63+
64+ article = Article (title = title_with_emojis )
65+ node = Utils .entity_to_dict (article , self .store .conventions .json_default_method )
66+ command = PutDocumentCommand ("articles/1" , None , node )
67+ self .store .get_request_executor ().execute_command (command )
68+
69+ result = command .result
70+
71+ self .assertIsNotNone (result .change_vector )
72+
73+ with self .store .open_session () as session :
74+ loaded_article = session .load ("articles/1" , Article )
75+ self .assertEqual (loaded_article .title , title_with_emojis )
0 commit comments