Skip to content
Snippets Groups Projects
Commit a68883c4 authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

TST: adapted test to use member function instead of copy_entity

parent f3622f43
No related branches found
No related tags found
2 merge requests!57RELEASE 0.7.3,!45F copy entity
Pipeline #21658 passed with warnings
...@@ -31,7 +31,7 @@ import tempfile ...@@ -31,7 +31,7 @@ import tempfile
import caosdb as db import caosdb as db
import caosdb.apiutils import caosdb.apiutils
from caosdb.apiutils import (apply_to_ids, compare_entities, create_id_query, from caosdb.apiutils import (apply_to_ids, compare_entities, create_id_query,
resolve_reference, copy_entity, merge_entities) resolve_reference, merge_entities)
from .test_property import testrecord from .test_property import testrecord
...@@ -241,10 +241,11 @@ def test_copy_entities(): ...@@ -241,10 +241,11 @@ def test_copy_entities():
r.add_property(name="D", value=[3, 4, 7], importance="OBLIGATORY") r.add_property(name="D", value=[3, 4, 7], importance="OBLIGATORY")
r.description = "A fancy test record" r.description = "A fancy test record"
c = copy_entity(r) c = r.copy()
assert c != r assert c is not r
assert c.name == "A" assert c.name == "A"
assert c.role == r.role
assert c.parents[0].name == "B" assert c.parents[0].name == "B"
# Currently parents and properties are always individual to a copy: # Currently parents and properties are always individual to a copy:
assert c.parents[0] != r.parents[0] assert c.parents[0] != r.parents[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment