From 48218a719da209c436ab06c39e39c561d17c80cf Mon Sep 17 00:00:00 2001 From: fspreck <f.spreckelsen@indiscale.com> Date: Mon, 10 Jun 2024 12:45:34 +0200 Subject: [PATCH] TST: Add test for https://gitlab.com/linkahead/linkahead-server/-/issues/264 --- tests/test_issues_server.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/test_issues_server.py b/tests/test_issues_server.py index 17b1bd5..bf760fb 100644 --- a/tests/test_issues_server.py +++ b/tests/test_issues_server.py @@ -1291,7 +1291,8 @@ def test_143_white_space(num): ]: with pytest.raises(TransactionError) as cm: db.execute_query(query) - assert cm.value.msg == f'You typed "{num}". Empty spaces are not allowed in numbers. Did you mean "{num.replace(" ", "")}"?' + assert cm.value.msg == (f'You typed "{num}". Empty spaces are not allowed ' + + f'in numbers. Did you mean "{num.replace(" ", "")}"?') def test_144(): @@ -1529,3 +1530,22 @@ def test_263(): db.Record(name="1").retrieve() assert len(exc.errors) == 1 assert exc.errors[0].msg == "Entity does not exist." # TODO Or whatever the message shall be. + + +@pytest.mark.xfail(reason="https://gitlab.com/linkahead/linkahead-server/-/issues/264") +def test_264_accents_and_umlauts(): + """Test whether queries respect accents and + umlauts. https://gitlab.com/linkahead/linkahead-server/-/issues/264. + + """ + + # Insertes have to be possible with unique=True since the name differ in + # accents and umlauts. + rt_e = db.RecordType(name="Test").insert() + rt_ë = db.RecordType(name="Tëst").insert() + rt_è = db.RecordType(name="Tést").insert() + + # Retrieves should be unique here, too. + for rt in [rt_e, rt_ë, rt_è]: + retrieved = db.get_entity_by_name(rt.name) + assert retrieved.id == rt.id -- GitLab