|
@@ -901,6 +901,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
901
|
901
|
assert user_role['user']['public_name'] == 'Global manager'
|
902
|
902
|
assert user_role['user']['user_id'] == 1
|
903
|
903
|
assert user_role['is_active'] is True
|
|
904
|
+ assert user_role['do_notify'] is True
|
904
|
905
|
# TODO - G.M - 24-05-2018 - [Avatar] Replace
|
905
|
906
|
# by correct value when avatar feature will be enabled
|
906
|
907
|
assert user_role['user']['avatar_url'] is None
|
|
@@ -975,6 +976,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
975
|
976
|
'user_id': 2,
|
976
|
977
|
'user_email_or_public_name': None,
|
977
|
978
|
'role': 'content-manager',
|
|
979
|
+ 'do_notify': False,
|
978
|
980
|
}
|
979
|
981
|
res = self.testapp.post_json(
|
980
|
982
|
'/api/v2/workspaces/1/members',
|
|
@@ -987,6 +989,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
987
|
989
|
assert user_role_found['workspace_id'] == 1
|
988
|
990
|
assert user_role_found['newly_created'] is False
|
989
|
991
|
assert user_role_found['email_sent'] is False
|
|
992
|
+ assert user_role_found['do_notify'] is False
|
990
|
993
|
|
991
|
994
|
res = self.testapp.get('/api/v2/workspaces/1/members', status=200).json_body # nopep8
|
992
|
995
|
assert len(res) == 2
|
|
@@ -1016,6 +1019,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1016
|
1019
|
'user_id': None,
|
1017
|
1020
|
'user_email_or_public_name': 'lawrence-not-real-email@fsf.local',
|
1018
|
1021
|
'role': 'content-manager',
|
|
1022
|
+ 'do_notify': 'True',
|
1019
|
1023
|
}
|
1020
|
1024
|
res = self.testapp.post_json(
|
1021
|
1025
|
'/api/v2/workspaces/1/members',
|
|
@@ -1028,6 +1032,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1028
|
1032
|
assert user_role_found['workspace_id'] == 1
|
1029
|
1033
|
assert user_role_found['newly_created'] is False
|
1030
|
1034
|
assert user_role_found['email_sent'] is False
|
|
1035
|
+ assert user_role_found['do_notify'] is True
|
1031
|
1036
|
|
1032
|
1037
|
res = self.testapp.get('/api/v2/workspaces/1/members', status=200).json_body # nopep8
|
1033
|
1038
|
assert len(res) == 2
|
|
@@ -1057,6 +1062,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1057
|
1062
|
'user_id': None,
|
1058
|
1063
|
'user_email_or_public_name': 'Lawrence L.',
|
1059
|
1064
|
'role': 'content-manager',
|
|
1065
|
+ 'do_notify': True,
|
1060
|
1066
|
}
|
1061
|
1067
|
res = self.testapp.post_json(
|
1062
|
1068
|
'/api/v2/workspaces/1/members',
|
|
@@ -1069,6 +1075,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1069
|
1075
|
assert user_role_found['workspace_id'] == 1
|
1070
|
1076
|
assert user_role_found['newly_created'] is False
|
1071
|
1077
|
assert user_role_found['email_sent'] is False
|
|
1078
|
+ assert user_role_found['do_notify'] is True
|
1072
|
1079
|
|
1073
|
1080
|
res = self.testapp.get('/api/v2/workspaces/1/members', status=200).json_body # nopep8
|
1074
|
1081
|
assert len(res) == 2
|
|
@@ -1098,6 +1105,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1098
|
1105
|
'user_id': None,
|
1099
|
1106
|
'user_email_or_public_name': None,
|
1100
|
1107
|
'role': 'content-manager',
|
|
1108
|
+ 'do_notify': True,
|
1101
|
1109
|
}
|
1102
|
1110
|
res = self.testapp.post_json(
|
1103
|
1111
|
'/api/v2/workspaces/1/members',
|
|
@@ -1122,6 +1130,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1122
|
1130
|
'user_id': 47,
|
1123
|
1131
|
'user_email_or_public_name': None,
|
1124
|
1132
|
'role': 'content-manager',
|
|
1133
|
+ 'do_notify': True,
|
1125
|
1134
|
}
|
1126
|
1135
|
res = self.testapp.post_json(
|
1127
|
1136
|
'/api/v2/workspaces/1/members',
|
|
@@ -1146,6 +1155,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1146
|
1155
|
'user_id': None,
|
1147
|
1156
|
'user_email_or_public_name': 'nothing@nothing.nothing',
|
1148
|
1157
|
'role': 'content-manager',
|
|
1158
|
+ 'do_notify': True,
|
1149
|
1159
|
}
|
1150
|
1160
|
res = self.testapp.post_json(
|
1151
|
1161
|
'/api/v2/workspaces/1/members',
|
|
@@ -1159,6 +1169,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1159
|
1169
|
assert user_role_found['workspace_id'] == 1
|
1160
|
1170
|
assert user_role_found['newly_created'] is True
|
1161
|
1171
|
assert user_role_found['email_sent'] is False
|
|
1172
|
+ assert user_role_found['do_notify'] is True
|
1162
|
1173
|
|
1163
|
1174
|
res = self.testapp.get('/api/v2/workspaces/1/members',
|
1164
|
1175
|
status=200).json_body # nopep8
|
|
@@ -1193,6 +1204,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1193
|
1204
|
# update workspace role
|
1194
|
1205
|
params = {
|
1195
|
1206
|
'role': 'content-manager',
|
|
1207
|
+ 'do_notify': False,
|
1196
|
1208
|
}
|
1197
|
1209
|
res = self.testapp.put_json(
|
1198
|
1210
|
'/api/v2/workspaces/1/members/1',
|
|
@@ -1208,6 +1220,7 @@ class TestWorkspaceMembersEndpoint(FunctionalTest):
|
1208
|
1220
|
assert len(res) == 1
|
1209
|
1221
|
user_role = res[0]
|
1210
|
1222
|
assert user_role['role'] == 'content-manager'
|
|
1223
|
+ assert user_role['do_notify'] is False
|
1211
|
1224
|
assert user_role['user_id'] == 1
|
1212
|
1225
|
assert user_role['workspace_id'] == 1
|
1213
|
1226
|
|
|
@@ -1350,6 +1363,7 @@ class TestUserInvitationWithMailActivatedSync(FunctionalTest):
|
1350
|
1363
|
'user_id': None,
|
1351
|
1364
|
'user_email_or_public_name': 'bob@bob.bob',
|
1352
|
1365
|
'role': 'content-manager',
|
|
1366
|
+ 'do_notify': True,
|
1353
|
1367
|
}
|
1354
|
1368
|
res = self.testapp.post_json(
|
1355
|
1369
|
'/api/v2/workspaces/1/members',
|
|
@@ -1363,6 +1377,7 @@ class TestUserInvitationWithMailActivatedSync(FunctionalTest):
|
1363
|
1377
|
assert user_role_found['workspace_id'] == 1
|
1364
|
1378
|
assert user_role_found['newly_created'] is True
|
1365
|
1379
|
assert user_role_found['email_sent'] is True
|
|
1380
|
+ assert user_role_found['do_notify'] is True
|
1366
|
1381
|
|
1367
|
1382
|
# check mail received
|
1368
|
1383
|
response = requests.get('http://127.0.0.1:8025/api/v1/messages')
|
|
@@ -1399,6 +1414,7 @@ class TestUserInvitationWithMailActivatedASync(FunctionalTest):
|
1399
|
1414
|
'user_id': None,
|
1400
|
1415
|
'user_email_or_public_name': 'bob@bob.bob',
|
1401
|
1416
|
'role': 'content-manager',
|
|
1417
|
+ 'do_notify': True,
|
1402
|
1418
|
}
|
1403
|
1419
|
res = self.testapp.post_json(
|
1404
|
1420
|
'/api/v2/workspaces/1/members',
|