diff options
Diffstat (limited to 'python/tests/api_entity_state.py')
-rw-r--r-- | python/tests/api_entity_state.py | 18 |
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 |