Skip to content

Commit 93971bd

Browse files
committed
Use new method in editor test
1 parent e1b806e commit 93971bd

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

mergin/test/test_client.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2599,17 +2599,17 @@ def test_editor_push(mc: MerginClient, mc2: MerginClient):
25992599
"""Test push with editor"""
26002600
if not mc.has_editor_support():
26012601
return
2602-
test_project = "test_editor_push"
2603-
test_project_fullname = API_USER + "/" + test_project
2604-
project = API_USER + "/" + test_project
2605-
project_dir = os.path.join(TMP_DIR, test_project)
2606-
project_dir2 = os.path.join(TMP_DIR, test_project + "_2")
2607-
cleanup(mc, project, [project_dir, project_dir2])
2602+
test_project_name = "test_editor_push"
2603+
test_project_fullname = API_USER + "/" + test_project_name
2604+
project_dir = os.path.join(TMP_DIR, test_project_name)
2605+
project_dir2 = os.path.join(TMP_DIR, test_project_name + "_2")
2606+
cleanup(mc, test_project_fullname, [project_dir, project_dir2])
26082607

26092608
# create new (empty) project on server
26102609
# TODO: return project_info from create project, don't use project_full name for project info, instead returned id of project
2611-
mc.create_project(test_project)
2612-
mc.add_user_permissions_to_project(project, [API_USER2], "editor")
2610+
mc.create_project(test_project_name)
2611+
project_info = get_project_info(mc, API_USER, test_project_name)
2612+
mc.add_project_collaborator(project_info["id"], mc2.username(), ProjectRole.EDITOR)
26132613
# download empty project
26142614
mc2.download_project(test_project_fullname, project_dir)
26152615

@@ -2651,12 +2651,11 @@ def test_editor_push(mc: MerginClient, mc2: MerginClient):
26512651
# editor is trying to update qgis file
26522652
with open(os.path.join(project_dir, qgs_file_name), "a") as f:
26532653
f.write("Editor is here!")
2654-
project_info = mc2.project_info(test_project_fullname)
26552654
pull_changes, push_changes, push_changes_summary = mc.project_status(project_dir)
26562655
# ggs is still waiting to push
26572656
assert any(file["path"] == qgs_file_name for file in push_changes.get("updated")) is True
26582657

2659-
# push as owner do cleanup local changes and preparation to conflicited copy simulate
2658+
# push as owner do cleanup local changes and preparation to conflicted copy simulate
26602659
mc.push_project(project_dir)
26612660

26622661
# simulate conflicting copy of qgis file

0 commit comments

Comments
 (0)