Skip to content
Snippets Groups Projects
Commit cda49965 authored by I. Nüske's avatar I. Nüske
Browse files

TST: Add test for https://gitlab.com/linkahead/linkahead-pylib/-/issues/123 and update changelog

parent aeacf439
Branches
Tags
1 merge request!87Test for https://gitlab.com/linkahead/linkahead-pylib/-/issues/123
Pipeline #58771 failed
......@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added (for new features)
* Test for [linkahead-pylib#123](https://gitlab.com/linkahead/linkahead-pylib/-/issues/123)
* Tests for [linkahead-server#280](https://gitlab.com/linkahead/linkahead-server/-/issues/280)
* Test for [caosdb-pylib#119](https://gitlab.com/linkahead/linkahead-pylib/-/issues/119)
* Test for [caosdb-pylib#89](https://gitlab.com/linkahead/linkahead-pylib/-/issues/89)
......
......@@ -196,3 +196,25 @@ def test_gitlab_com_120():
rt1_retrieved.update()
# The update and addition of a new property must not change this, either.
assert len(rt1_retrieved.get_property(rt2.name).properties) == 0
def test_gitlab_com_123():
"""
Test that Entity Role is taken into account when retrieving entities with
ambiguous name.
See https://gitlab.com/linkahead/linkahead-pylib/-/issues/123.
"""
# Create ambiguous situation
db.RecordType(name="TestUniquenessRecordType").insert()
f = db.File(file="__init__.py", path="__init__.py")
f.insert()
f.name = "TestUniquenessRecordType"
f.update(unique=False)
# Check that only the file is retrieved and unique retrieve works
cont = db.File("TestUniquenessRecordType").retrieve(unique=False)
assert len(cont) == 1
file = db.File("TestUniquenessRecordType").retrieve()
assert file.role == "File"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment