diff --git a/tests/test_issues_server.py b/tests/test_issues_server.py index 7762838c469f17b098ef7ac3e59c6ffc1b55ee42..9a6f572d4eefe9014f74b1f51e8656d0d3be1b3c 100644 --- a/tests/test_issues_server.py +++ b/tests/test_issues_server.py @@ -1432,3 +1432,25 @@ See https://gitlab.indiscale.com/caosdb/src/caosdb-server/-/issues/106 # Existing Property should still be reported as TEXT assert db.Record(id=r.id).retrieve().get_property("prop").datatype == db.TEXT + + +@pytest.mark.xfail(reason="https://gitlab.com/caosdb/caosdb-server/-/issues/235") +def test_235_long_name(): + """Should give an appropriate error.""" + length = 256 + name = "N" * length + rt1 = db.RecordType(name=name) + try: + rt1.insert() + except Exception as exc: + assert type(Exception) is not db.HTTPServerError + # TODO more specific error should be asserted + + rt2 = db.RecordType(name="Short") + rt2.insert() + rt2.name = name + try: + rt2.update() + except Exception as exc: + assert type(Exception) is not db.HTTPServerError + # TODO more specific error should be asserted