Skip to content
Snippets Groups Projects
Verified Commit d3f8c7bb authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: automatic record state

parent 4e75f06b
Branches
Tags
1 merge request!3F fsm
......@@ -3,10 +3,10 @@ import caosdb as db
from caosdb import administration as admin
_ORIGINAL_EXT_ENTITY_STATE = ""
# _DELETE_ROLES = ["reviewer", "team-leader", "normal"]
# _DELETE_USERS = ["reviewer_user", "team-leader_user", "normal_user"]
_DELETE_ROLES = []
_DELETE_USERS = []
_DELETE_ROLES = ["reviewer", "team-leader", "normal"]
_DELETE_USERS = ["reviewer_user", "team-leader_user", "normal_user"]
# _DELETE_ROLES = []
# _DELETE_USERS = []
_PASSWORD = "1234asdf!P"
......@@ -687,3 +687,17 @@ def test_full_edit_review_publish_cycle():
switch_to_test_user("normal")
rec.get_property("TestProperty").value = next(val)
rec.update()
def test_automatic_record_state():
rt = db.RecordType("StateFullRT").add_parent("TestRT")
rt.state = db.State(model="Model1", name="State1")
rt.insert()
rec = db.Record("TestRec").add_parent("StateFullRT")
rec.insert()
assert rec.state == db.State(model="Model1", name="State1")
rec_retrieve = db.Record(id=rec.id).retrieve()
assert rec_retrieve.state == db.State(model="Model1", name="State1")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment