|
@@ -905,6 +905,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
905
|
905
|
assert user_role['user']['public_name'] == 'Global manager'
|
906
|
906
|
assert user_role['user']['user_id'] == 1
|
907
|
907
|
assert user_role['is_active'] is True
|
|
908
|
+ assert user_role['do_notify'] is True
|
908
|
909
|
# TODO - G.M - 24-05-2018 - [Avatar] Replace
|
909
|
910
|
# by correct value when avatar feature will be enabled
|
910
|
911
|
assert user_role['user']['avatar_url'] is None
|
|
@@ -979,6 +980,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
979
|
980
|
'user_id': 2,
|
980
|
981
|
'user_email_or_public_name': None,
|
981
|
982
|
'role': 'content-manager',
|
|
983
|
+ 'do_notify': False,
|
982
|
984
|
}
|
983
|
985
|
res = self.testapp.post_json(
|
984
|
986
|
'/api/v2/workspaces/1/members',
|
|
@@ -991,6 +993,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
991
|
993
|
assert user_role_found['workspace_id'] == 1
|
992
|
994
|
assert user_role_found['newly_created'] is False
|
993
|
995
|
assert user_role_found['email_sent'] is False
|
|
996
|
+ assert user_role_found['do_notify'] is False
|
994
|
997
|
|
995
|
998
|
res = self.testapp.get('/api/v2/workspaces/1/members', status=200).json_body # nopep8
|
996
|
999
|
assert len(res) == 2
|
|
@@ -1020,6 +1023,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1020
|
1023
|
'user_id': None,
|
1021
|
1024
|
'user_email_or_public_name': 'lawrence-not-real-email@fsf.local',
|
1022
|
1025
|
'role': 'content-manager',
|
|
1026
|
+ 'do_notify': 'True',
|
1023
|
1027
|
}
|
1024
|
1028
|
res = self.testapp.post_json(
|
1025
|
1029
|
'/api/v2/workspaces/1/members',
|
|
@@ -1032,6 +1036,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1032
|
1036
|
assert user_role_found['workspace_id'] == 1
|
1033
|
1037
|
assert user_role_found['newly_created'] is False
|
1034
|
1038
|
assert user_role_found['email_sent'] is False
|
|
1039
|
+ assert user_role_found['do_notify'] is True
|
1035
|
1040
|
|
1036
|
1041
|
res = self.testapp.get('/api/v2/workspaces/1/members', status=200).json_body # nopep8
|
1037
|
1042
|
assert len(res) == 2
|
|
@@ -1061,6 +1066,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1061
|
1066
|
'user_id': None,
|
1062
|
1067
|
'user_email_or_public_name': 'Lawrence L.',
|
1063
|
1068
|
'role': 'content-manager',
|
|
1069
|
+ 'do_notify': True,
|
1064
|
1070
|
}
|
1065
|
1071
|
res = self.testapp.post_json(
|
1066
|
1072
|
'/api/v2/workspaces/1/members',
|
|
@@ -1073,6 +1079,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1073
|
1079
|
assert user_role_found['workspace_id'] == 1
|
1074
|
1080
|
assert user_role_found['newly_created'] is False
|
1075
|
1081
|
assert user_role_found['email_sent'] is False
|
|
1082
|
+ assert user_role_found['do_notify'] is True
|
1076
|
1083
|
|
1077
|
1084
|
res = self.testapp.get('/api/v2/workspaces/1/members', status=200).json_body # nopep8
|
1078
|
1085
|
assert len(res) == 2
|
|
@@ -1102,6 +1109,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1102
|
1109
|
'user_id': None,
|
1103
|
1110
|
'user_email_or_public_name': None,
|
1104
|
1111
|
'role': 'content-manager',
|
|
1112
|
+ 'do_notify': True,
|
1105
|
1113
|
}
|
1106
|
1114
|
res = self.testapp.post_json(
|
1107
|
1115
|
'/api/v2/workspaces/1/members',
|
|
@@ -1126,6 +1134,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1126
|
1134
|
'user_id': 47,
|
1127
|
1135
|
'user_email_or_public_name': None,
|
1128
|
1136
|
'role': 'content-manager',
|
|
1137
|
+ 'do_notify': True,
|
1129
|
1138
|
}
|
1130
|
1139
|
res = self.testapp.post_json(
|
1131
|
1140
|
'/api/v2/workspaces/1/members',
|
|
@@ -1150,6 +1159,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1150
|
1159
|
'user_id': None,
|
1151
|
1160
|
'user_email_or_public_name': 'nothing@nothing.nothing',
|
1152
|
1161
|
'role': 'content-manager',
|
|
1162
|
+ 'do_notify': True,
|
1153
|
1163
|
}
|
1154
|
1164
|
res = self.testapp.post_json(
|
1155
|
1165
|
'/api/v2/workspaces/1/members',
|
|
@@ -1163,6 +1173,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1163
|
1173
|
assert user_role_found['workspace_id'] == 1
|
1164
|
1174
|
assert user_role_found['newly_created'] is True
|
1165
|
1175
|
assert user_role_found['email_sent'] is False
|
|
1176
|
+ assert user_role_found['do_notify'] is True
|
1166
|
1177
|
|
1167
|
1178
|
res = self.testapp.get('/api/v2/workspaces/1/members',
|
1168
|
1179
|
status=200).json_body # nopep8
|
|
@@ -1197,6 +1208,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1197
|
1208
|
# update workspace role
|
1198
|
1209
|
params = {
|
1199
|
1210
|
'role': 'content-manager',
|
|
1211
|
+ 'do_notify': False,
|
1200
|
1212
|
}
|
1201
|
1213
|
res = self.testapp.put_json(
|
1202
|
1214
|
'/api/v2/workspaces/1/members/1',
|
|
@@ -1212,6 +1224,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1212
|
1224
|
assert len(res) == 1
|
1213
|
1225
|
user_role = res[0]
|
1214
|
1226
|
assert user_role['role'] == 'content-manager'
|
|
1227
|
+ assert user_role['do_notify'] is False
|
1215
|
1228
|
assert user_role['user_id'] == 1
|
1216
|
1229
|
assert user_role['workspace_id'] == 1
|
1217
|
1230
|
|
|
@@ -1354,6 +1367,7 @@ class TestUserInvitationWithMailActivatedSync(FunctionalTest):
|
1354
|
1367
|
'user_id': None,
|
1355
|
1368
|
'user_email_or_public_name': 'bob@bob.bob',
|
1356
|
1369
|
'role': 'content-manager',
|
|
1370
|
+ 'do_notify': True,
|
1357
|
1371
|
}
|
1358
|
1372
|
res = self.testapp.post_json(
|
1359
|
1373
|
'/api/v2/workspaces/1/members',
|
|
@@ -1367,6 +1381,7 @@ class TestUserInvitationWithMailActivatedSync(FunctionalTest):
|
1367
|
1381
|
assert user_role_found['workspace_id'] == 1
|
1368
|
1382
|
assert user_role_found['newly_created'] is True
|
1369
|
1383
|
assert user_role_found['email_sent'] is True
|
|
1384
|
+ assert user_role_found['do_notify'] is True
|
1370
|
1385
|
|
1371
|
1386
|
# check mail received
|
1372
|
1387
|
response = requests.get('http://127.0.0.1:8025/api/v1/messages')
|
|
@@ -1403,6 +1418,7 @@ class TestUserInvitationWithMailActivatedASync(FunctionalTest):
|
1403
|
1418
|
'user_id': None,
|
1404
|
1419
|
'user_email_or_public_name': 'bob@bob.bob',
|
1405
|
1420
|
'role': 'content-manager',
|
|
1421
|
+ 'do_notify': True,
|
1406
|
1422
|
}
|
1407
|
1423
|
res = self.testapp.post_json(
|
1408
|
1424
|
'/api/v2/workspaces/1/members',
|