Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CaosDB Python Integration Tests
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Python Integration Tests
Commits
deaa3317
Verified
Commit
deaa3317
authored
4 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: test for deletion of references in old versions
parent
2696aaa9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_version.py
+32
-0
32 additions, 0 deletions
tests/test_version.py
with
32 additions
and
0 deletions
tests/test_version.py
+
32
−
0
View file @
deaa3317
...
...
@@ -747,3 +747,35 @@ def test_overridden_datatype():
rt_old
=
c
.
Container
().
retrieve
(
query
=
str
(
rt
.
id
)
+
"
@HEAD~1
"
,
flags
=
{
"
cache
"
:
"
false
"
},
sync
=
False
)
assert
rt
.
get_property
(
"
TestProperty
"
).
datatype
==
c
.
LIST
(
c
.
TEXT
)
def
test_delete_referenced_entity
():
ref_rt
=
c
.
RecordType
(
"
TestReferencedRT
"
).
insert
()
rt
=
c
.
RecordType
(
"
TestRT
"
).
insert
()
ref
=
c
.
Record
(
"
TestRef1
"
).
add_parent
(
ref_rt
).
insert
()
rec
=
c
.
Record
(
"
TestRec
"
).
add_parent
(
rt
).
add_property
(
ref_rt
,
ref
).
insert
()
rec
.
description
=
"
v2
"
rec
.
remove_property
(
ref_rt
)
rec
.
update
()
rec_v1
=
c
.
Container
().
retrieve
(
query
=
str
(
rec
.
id
)
+
"
@HEAD~1
"
,
flags
=
{
"
cache
"
:
"
false
"
},
sync
=
False
)[
0
]
assert
rec_v1
.
get_property
(
ref_rt
).
value
==
ref
.
id
rec_v2
=
c
.
Container
().
retrieve
(
query
=
str
(
rec
.
id
)
+
"
@HEAD
"
,
flags
=
{
"
cache
"
:
"
false
"
},
sync
=
False
)[
0
]
assert
rec_v2
.
get_property
(
ref_rt
)
is
None
ref
.
delete
()
rec_v1
=
c
.
Container
().
retrieve
(
query
=
str
(
rec
.
id
)
+
"
@HEAD~1
"
,
flags
=
{
"
cache
"
:
"
false
"
},
sync
=
False
)[
0
]
assert
rec_v1
.
get_property
(
ref_rt
).
value
is
None
assert
rec_v1
.
get_property
(
ref_rt
).
get_warnings
()[
0
].
description
==
"
The referenced entity has been deleted in the mean time and is not longer available.
"
rec_v2
=
c
.
Container
().
retrieve
(
query
=
str
(
rec
.
id
)
+
"
@HEAD
"
,
flags
=
{
"
cache
"
:
"
false
"
},
sync
=
False
)[
0
]
assert
rec_v2
.
get_property
(
ref_rt
)
is
None
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment