summaryrefslogtreecommitdiffstats
path: root/python/tests/api_entity_editing.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/tests/api_entity_editing.py')
-rw-r--r--python/tests/api_entity_editing.py52
1 files changed, 26 insertions, 26 deletions
diff --git a/python/tests/api_entity_editing.py b/python/tests/api_entity_editing.py
index d14b949b..377d47a8 100644
--- a/python/tests/api_entity_editing.py
+++ b/python/tests/api_entity_editing.py
@@ -14,30 +14,30 @@ def test_multiple_edits_same_group(api):
# create
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup=eg.id).ident)
- api.accept_editgroup(eg.id)
+ c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ api.accept_editgroup(eg.editgroup_id)
# try multiple edits in the same group
eg = quick_eg(api)
c2 = CreatorEntity(display_name="left")
c3 = CreatorEntity(display_name="right")
- edit = api.update_creator(c1.ident, c2, editgroup=eg.id)
+ edit = api.update_creator(c1.ident, c2, editgroup_id=eg.editgroup_id)
# should fail with existing
with pytest.raises(fatcat_client.rest.ApiException):
- api.update_creator(c1.ident, c3, editgroup=eg.id)
+ api.update_creator(c1.ident, c3, editgroup_id=eg.editgroup_id)
# ... but succeed after deleting
api.delete_creator_edit(edit.edit_id)
- api.update_creator(c1.ident, c3, editgroup=eg.id)
- api.accept_editgroup(eg.id)
+ api.update_creator(c1.ident, c3, editgroup_id=eg.editgroup_id)
+ api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c1.ident)
assert res.display_name == "right"
- eg = api.get_editgroup(eg.id)
+ eg = api.get_editgroup(eg.editgroup_id)
assert len(eg.edits.creators) == 1
# cleanup
eg = quick_eg(api)
api.delete_creator(c1.ident)
- api.accept_editgroup(eg.id)
+ api.accept_editgroup(eg.editgroup_id)
def test_edit_after_accept(api):
@@ -46,13 +46,13 @@ def test_edit_after_accept(api):
# create
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup=eg.id).ident)
- api.accept_editgroup(eg.id)
+ c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ api.accept_editgroup(eg.editgroup_id)
# should be unable to create an edit on an old editgroup
c2 = CreatorEntity(display_name="left")
try:
- api.create_creator(c2, editgroup=eg.id)
+ api.create_creator(c2, editgroup_id=eg.editgroup_id)
assert False
except fatcat_client.rest.ApiException as e:
assert 400 <= e.status < 500
@@ -62,7 +62,7 @@ def test_edit_after_accept(api):
# cleanup
eg = quick_eg(api)
api.delete_creator(c1.ident)
- api.accept_editgroup(eg.id)
+ api.accept_editgroup(eg.editgroup_id)
def test_edit_deletion(api):
@@ -71,36 +71,36 @@ def test_edit_deletion(api):
# create
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup=eg.id).ident)
- api.accept_editgroup(eg.id)
+ c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
+ api.accept_editgroup(eg.editgroup_id)
# try multiple edits in the same group
c2 = CreatorEntity(display_name="update one")
eg = quick_eg(api)
- eg = api.get_editgroup(eg.id)
+ eg = api.get_editgroup(eg.editgroup_id)
assert len(eg.edits.creators) == 0
- edit = api.update_creator(c1.ident, c2, editgroup=eg.id)
- eg = api.get_editgroup(eg.id)
+ edit = api.update_creator(c1.ident, c2, editgroup_id=eg.editgroup_id)
+ eg = api.get_editgroup(eg.editgroup_id)
assert len(eg.edits.creators) == 1
api.delete_creator_edit(edit.edit_id)
- eg = api.get_editgroup(eg.id)
+ eg = api.get_editgroup(eg.editgroup_id)
assert len(eg.edits.creators) == 0
- api.accept_editgroup(eg.id)
+ api.accept_editgroup(eg.editgroup_id)
res = api.get_creator(c1.ident)
assert res.display_name == "test edit updates"
- eg = api.get_editgroup(eg.id)
+ eg = api.get_editgroup(eg.editgroup_id)
assert len(eg.edits.creators) == 0
# cleanup
eg = quick_eg(api)
api.delete_creator(c1.ident)
- api.accept_editgroup(eg.id)
+ api.accept_editgroup(eg.editgroup_id)
def test_empty_editgroup(api):
eg = quick_eg(api)
- api.accept_editgroup(eg.id)
+ api.accept_editgroup(eg.editgroup_id)
def test_delete_accepted_edit(api):
@@ -109,8 +109,8 @@ def test_delete_accepted_edit(api):
# create
eg = quick_eg(api)
- edit = api.create_creator(c1, editgroup=eg.id)
- api.accept_editgroup(eg.id)
+ edit = api.create_creator(c1, editgroup_id=eg.editgroup_id)
+ api.accept_editgroup(eg.editgroup_id)
# try to delete
try:
@@ -127,7 +127,7 @@ def test_wip_revision(api):
# fetch revision before accepting
eg = quick_eg(api)
- c1 = api.get_creator(api.create_creator(c1, editgroup=eg.id).ident)
+ c1 = api.get_creator(api.create_creator(c1, editgroup_id=eg.editgroup_id).ident)
rev = api.get_creator_revision(c1.revision)
assert "nugget" in rev.display_name
assert rev.state is None
@@ -135,7 +135,7 @@ def test_wip_revision(api):
assert rev.revision == c1.revision
# fetch revision after accepting
- api.accept_editgroup(eg.id)
+ api.accept_editgroup(eg.editgroup_id)
rev = api.get_creator_revision(c1.revision)
assert "nugget" in rev.display_name
assert rev.state is None