diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/tests/api_entity_redirects.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/python/tests/api_entity_redirects.py b/python/tests/api_entity_redirects.py index 9bcd255c..208688e9 100644 --- a/python/tests/api_entity_redirects.py +++ b/python/tests/api_entity_redirects.py @@ -151,6 +151,9 @@ def test_delete_entity(api): # delete eg = quick_eg(api) api.delete_creator(c1.ident, editgroup=eg.id) + with pytest.raises(fatcat_client.rest.ApiException): + # can't re-delete in same editgroup + api.delete_creator(c1.ident, editgroup=eg.id) api.accept_editgroup(eg.id) res = api.get_creator(c1.ident) assert res.state == "deleted" @@ -158,6 +161,18 @@ def test_delete_entity(api): with pytest.raises(fatcat_client.rest.ApiException): res = api.lookup_creator(orcid=c1.orcid) + # re-delete + eg = quick_eg(api) + try: + # can't re-delete an entity + api.delete_creator(c1.ident, editgroup=eg.id) + #api.accept_editgroup(eg.id) + assert False + except fatcat_client.rest.ApiException as e: + # error is 4xx + print(e) + assert 400 <= e.status < 500 + # undelete eg = quick_eg(api) api.update_creator(c1.ident, c1, editgroup=eg.id) |