diff --git a/integrationtests/test_issues.py b/integrationtests/test_issues.py new file mode 100644 index 0000000000000000000000000000000000000000..05c36d805cc7a4013a332c944a36a10afaf5a8ae --- /dev/null +++ b/integrationtests/test_issues.py @@ -0,0 +1,43 @@ +# This file is a part of the CaosDB Project. +# +# Copyright (C) 2022 Indiscale GmbH <info@indiscale.com> +# 2022 Florian Spreckelsen <f.spreckelsen@indiscale.com> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +from pytest import fixture + +import caosdb as db + + +@fixture +def clear_database(): + db.execute_query("FIND ENTITY").delete() + + +def test_issue_23(clear_database): + """Test that an update leaves existing properties, that were not found by + the crawler, unchanged. + + """ + + # insert a simplistic model + prop_ident = db.Property(name="identifying_prop", datatype=db.TEXT) + prop_a = db.Property(name="prop_a", datatype=db.TEXT) + prop_b = db.Property(name="prop_b", datatype=db.TEXT) + rt = db.RecordType(name="TestType") + rec = db.Record(name="TestRec").add_parent(rt) + rec.add_property(name="identifying_prop", value="identifier") + rec.add_property(name="prop_a", value="something") + db.Container().extend([prop_ident, prop_a, prop_b, rt, rec]).insert()