6
6
from ravendb .tools .utils import Utils
7
7
8
8
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
+
9
19
class TestPutDocumentCommand (TestBase ):
10
20
def setUp (self ):
11
21
super ().setUp ()
@@ -27,9 +37,9 @@ def test_can_put_document_using_command(self):
27
37
loaded_user = session .load ("users/1" , User )
28
38
self .assertEqual (loaded_user .name , "Gracjan" )
29
39
30
- @unittest .skip ("todo: Not passing on CI/CD" )
40
+ # @unittest.skip("todo: Not passing on CI/CD")
31
41
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 😡😡🤬😀"
33
43
34
44
user = User (name = name_with_emojis , age = 31 )
35
45
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):
45
55
with self .store .open_session () as session :
46
56
loaded_user = session .load ("users/2" , User )
47
57
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