Skip to content

Commit 5200090

Browse files
committed
adapts tests
1 parent fe2fae8 commit 5200090

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

services/web/server/tests/unit/with_dbs/02/test_projects_states_handlers.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
from simcore_postgres_database.models.products import products
6868
from simcore_postgres_database.models.wallets import wallets
6969
from simcore_service_webserver._meta import API_VTAG
70+
from simcore_service_webserver.application_settings import get_application_settings
7071
from simcore_service_webserver.db.models import UserRole
7172
from simcore_service_webserver.projects.models import ProjectDict
7273
from simcore_service_webserver.socketio.messages import SOCKET_IO_PROJECT_UPDATED_EVENT
@@ -1171,6 +1172,7 @@ async def test_get_active_project(
11711172
if expected == status.HTTP_200_OK:
11721173
pytest.fail("socket io connection should not fail")
11731174
assert client.app
1175+
11741176
# get active projects -> empty
11751177
get_active_projects_url = (
11761178
client.app.router["get_active_project"]
@@ -1197,7 +1199,25 @@ async def test_get_active_project(
11971199
client.app, ProjectID(user_project["uuid"])
11981200
)
11991201
assert not error
1200-
assert ProjectStateOutputSchema(**data.pop("state")).share_state.locked
1202+
1203+
# The realtime collaboration feature unlocks the projects since they can be edited by multiple users simultaneously
1204+
realtime_collaboration_settings = get_application_settings(
1205+
client.app
1206+
).WEBSERVER_REALTIME_COLLABORATION
1207+
realtime_collaboration_enabled = (
1208+
realtime_collaboration_settings
1209+
and realtime_collaboration_settings.RTC_MAX_NUMBER_OF_USERS
1210+
and realtime_collaboration_settings.RTC_MAX_NUMBER_OF_USERS > 1
1211+
)
1212+
1213+
share_state_locked = ProjectStateOutputSchema(
1214+
**data.pop("state")
1215+
).share_state.locked
1216+
assert (
1217+
not share_state_locked
1218+
if realtime_collaboration_enabled
1219+
else share_state_locked
1220+
)
12011221
data.pop("folderId")
12021222

12031223
user_project_last_change_date = user_project.pop("lastChangeDate")

0 commit comments

Comments
 (0)