From ee2b62e1ec5591750178c94db6c1be257c87dbf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Wed, 25 Nov 2020 14:28:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D1=82=D0=B5=D1=81=D1=82=20=D0=B4=D0=BB=D1=8F=20=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D0=B0=D1=82=D0=B0=20JSON=20=D1=81=20=D1=81?= =?UTF-8?q?=D0=BE=D0=B4=D0=B5=D1=80=D0=B6=D0=B0=D0=B5=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?=D0=BC=20unicode=20=D1=81=D0=B8=D0=BC=D0=B2=D0=BE=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/templates/format/test_json.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/templates/format/test_json.py b/tests/templates/format/test_json.py index 1cd6211..d127d76 100644 --- a/tests/templates/format/test_json.py +++ b/tests/templates/format/test_json.py @@ -84,3 +84,32 @@ class TestParsingMethods: template = document_1_object.make_template(document_2_object) document_1_object.join_template(template) assert document_1_object.document_text == document_2 + + def test_json_join_with_unicode_symbols(self): + original_text = '''{ + "Description[cs]": "Upravit hlasitost zařízení a aplikací", + "Description[da]": "Justér lydstyrke for enheder og programmer", + "Description[de]": "Anpassung der Lautstärke von Geräten und Anwendungen", + "Description[el]": "Προσαρμογή της έντασης των συσκευών και εφαρμογών", + "test": "true" +} +''' + + template_text = '''{ +"test": "false" +} +''' + + join_result = '''{ + "Description[cs]": "Upravit hlasitost zařízení a aplikací", + "Description[da]": "Justér lydstyrke for enheder og programmer", + "Description[de]": "Anpassung der Lautstärke von Geräten und Anwendungen", + "Description[el]": "Προσαρμογή της έντασης των συσκευών και εφαρμογών", + "test": "false" +} +''' + + original_object = JSONFormat(original_text, '/path/to/template') + template_object = JSONFormat(template_text, '/path/to/template') + original_object.join_template(template_object) + assert original_object.document_text == join_result