summaryrefslogtreecommitdiffstats
path: root/python/tests/api_entity_state.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-12-21 14:10:56 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-12-21 14:10:56 -0800
commit1a15624e13bfe0a3bdddb1f0c5bf8940c9f04a04 (patch)
tree02029146a5bc5079ec2c85dc7dc88c47a69a5352 /python/tests/api_entity_state.py
parent42265350c9f0b7a5731103c191a807a691f8f2ef (diff)
downloadfatcat-1a15624e13bfe0a3bdddb1f0c5bf8940c9f04a04.tar.gz
fatcat-1a15624e13bfe0a3bdddb1f0c5bf8940c9f04a04.zip
more edit edgecases; editgroup status check
Diffstat (limited to 'python/tests/api_entity_state.py')
-rw-r--r--python/tests/api_entity_state.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/python/tests/api_entity_state.py b/python/tests/api_entity_state.py
index 35a8527a..43827dff 100644
--- a/python/tests/api_entity_state.py
+++ b/python/tests/api_entity_state.py
@@ -426,3 +426,21 @@ def test_required_entity_fields(api):
assert 400 <= e.status < 500
assert "title" in e.body
+def test_revert_current_status(api):
+
+ c1 = CreatorEntity(display_name="test updates")
+
+ # create
+ eg = quick_eg(api)
+ c1 = api.get_creator(api.create_creator(c1, editgroup=eg.id).ident)
+ api.accept_editgroup(eg.id)
+
+ # try to "revert" to current revision
+ eg = quick_eg(api)
+ c1_revert = CreatorEntity(revision=c1.revision)
+ try:
+ api.update_creator(c1.ident, c1_revert, editgroup=eg.id)
+ assert False
+ except fatcat_client.rest.ApiException as e:
+ assert 400 <= e.status < 500
+ assert "current" in e.body