5
5
from ravendb .tests .test_base import TestBase
6
6
from ravendb .tools .utils import Utils
7
7
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
8
16
9
17
class TestPutDocumentCommand (TestBase ):
10
18
def setUp (self ):
@@ -27,7 +35,7 @@ def test_can_put_document_using_command(self):
27
35
loaded_user = session .load ("users/1" , User )
28
36
self .assertEqual (loaded_user .name , "Gracjan" )
29
37
30
- @unittest .skip ("todo: Not passing on CI/CD" )
38
+ # @unittest.skip("todo: Not passing on CI/CD")
31
39
def test_can_put_document_using_command_with_surrogate_pairs (self ):
32
40
name_with_emojis = "Gracjan \ud83d \ude21 \ud83d \ude21 \ud83e \udd2c \ud83d \ude00 😡😡🤬😀"
33
41
@@ -45,3 +53,19 @@ def test_can_put_document_using_command_with_surrogate_pairs(self):
45
53
with self .store .open_session () as session :
46
54
loaded_user = session .load ("users/2" , User )
47
55
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