mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-09 10:04:10 +02:00
Tests for unicode characters in nested JSON, refs #257
This commit is contained in:
parent
6f4f9a3eff
commit
a95954c481
1 changed files with 9 additions and 1 deletions
|
|
@ -748,7 +748,7 @@ def test_create_index_if_not_exists(fresh_db):
|
||||||
{"dictionary": {"nested": "complex"}},
|
{"dictionary": {"nested": "complex"}},
|
||||||
collections.OrderedDict(
|
collections.OrderedDict(
|
||||||
[
|
[
|
||||||
("key1", {"nested": "complex"}),
|
("key1", {"nested": ["cømplex"]}),
|
||||||
("key2", "foo"),
|
("key2", "foo"),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
|
@ -762,6 +762,14 @@ def test_insert_dictionaries_and_lists_as_json(fresh_db, data_structure):
|
||||||
assert data_structure == json.loads(row[1])
|
assert data_structure == json.loads(row[1])
|
||||||
|
|
||||||
|
|
||||||
|
def test_insert_list_nested_unicode(fresh_db):
|
||||||
|
fresh_db["test"].insert(
|
||||||
|
{"id": 1, "data": {"key1": {"nested": ["cømplex"]}}}, pk="id"
|
||||||
|
)
|
||||||
|
row = fresh_db.execute("select id, data from test").fetchone()
|
||||||
|
assert row[1] == '{"key1": {"nested": ["cømplex"]}}'
|
||||||
|
|
||||||
|
|
||||||
def test_insert_uuid(fresh_db):
|
def test_insert_uuid(fresh_db):
|
||||||
uuid4 = uuid.uuid4()
|
uuid4 = uuid.uuid4()
|
||||||
fresh_db["test"].insert({"uuid": uuid4})
|
fresh_db["test"].insert({"uuid": uuid4})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue