From 7b5662ab06550d3ff22e577e3e59f0169742b22b Mon Sep 17 00:00:00 2001 From: Florian Spreckelsen <f.spreckelsen@indiscale.com> Date: Tue, 4 Jun 2024 11:03:51 +0200 Subject: [PATCH] TST: Add test for https://gitlab.com/linkahead/linkahead-server/-/issues/260 --- tests/test_issues_server.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_issues_server.py b/tests/test_issues_server.py index d3f11b3..17b1bd5 100644 --- a/tests/test_issues_server.py +++ b/tests/test_issues_server.py @@ -1507,6 +1507,22 @@ def test_253(): assert len(results) == 0 +@pytest.mark.xfail(reason="https://gitlab.com/linkahead/linkahead-server/-/issues/260") +def test_260_datetime_without_date(): + """Only time value in datetime property must not cause an unexpected server + error but an unqulified properties error, see + https://gitlab.com/linkahead/linkahead-server/-/issues/260. + + """ + prop = db.Property(name="TestDateTimeProp", datatype=db.DATETIME).insert() + rt = db.RecordType(name="TestType").add_property(prop).insert() + with pytest.raises(TransactionError) as te: + rec = db.Record().add_parent(rt).add_property(name=prop.name, value="11:00") + rec.insert() + assert te.value.has_error(db.UnqualifiedPropertiesError) + assert "Cannot parse value to datetime format" in te.value.msg + + @pytest.mark.xfail(reason="https://gitlab.com/linkahead/linkahead-server/-/issues/263") def test_263(): with pytest.raises(TransactionError) as exc: -- GitLab