Skip to content

Commit d9b1428

Browse files
committed
tests: fixes tests after package updates
Signed-off-by: Pamfilos Fokianos <[email protected]>
1 parent 1a03321 commit d9b1428

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
'Flask-Debugtoolbar',
5959
'flask-wtf==0.15.1',
6060
'flask-login==0.4.1',
61+
'flask-mail<0.10.0',
6162

6263
# CAP specific libraries
6364
'jsonref>=1.0.0',

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def default_config():
126126
DEBUG=False,
127127
TESTING=True,
128128
APP_GITLAB_OAUTH_ACCESS_TOKEN='testtoken',
129-
MAIL_DEFAULT_SENDER="analysis-preservation-support@cern.ch",
129+
MAIL_DEFAULT_SENDER="testtest@cern0.ch",
130130
CADI_REGEX="^[A-Z]{3}-[0-9]{2}-[0-9]{3}$",
131131
CMS_STATS_COMMITEE_AND_PAGS=dict({
132132
'ABC': {

tests/integration/deposits/test_files_for_deposit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def test_deposit_files_returns_list_with_files_info(client, users,
123123
resp = client.get('/deposits/{}/files'.format(pid),
124124
headers=auth_headers_for_user(owner))
125125

126-
files = resp.json
126+
files = json.loads(resp.data)
127127

128128
assert files[0]["filename"] == 'file_1.txt'
129129
assert files[0]["filesize"] == 12

tests/integration/deposits/test_get_deposits.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ def test_get_deposits_with_range_query(
10851085
def test_get_deposit_when_superuser_returns_deposit_that_he_even_has_no_access_to(
10861086
client, users, auth_headers_for_superuser, create_deposit
10871087
):
1088-
deposit = create_deposit(users['alice_user'], 'alice')
1088+
deposit = create_deposit(users['lhcb_user'], 'lhcb')
10891089

10901090
resp = client.get(
10911091
'/deposits/{}'.format(deposit['_deposit']['id']),
@@ -1098,8 +1098,8 @@ def test_get_deposit_when_superuser_returns_deposit_that_he_even_has_no_access_t
10981098
def test_get_deposit_when_owner_returns_deposit(
10991099
client, users, auth_headers_for_user, create_deposit
11001100
):
1101-
user = users['alice_user']
1102-
deposit = create_deposit(user, 'alice')
1101+
user = users['lhcb_user']
1102+
deposit = create_deposit(user, 'lhcb')
11031103

11041104
resp = client.get(
11051105
'/deposits/{}'.format(deposit['_deposit']['id']),
@@ -1112,8 +1112,8 @@ def test_get_deposit_when_owner_returns_deposit(
11121112
def test_get_deposit_when_other_member_of_collaboration_returns_403(
11131113
client, users, auth_headers_for_user, create_deposit
11141114
):
1115-
user, other_user = users['alice_user'], users['alice_user2']
1116-
deposit = create_deposit(user, 'alice')
1115+
user, other_user = users['lhcb_user'], users['lhcb_user2']
1116+
deposit = create_deposit(user, 'lhcb')
11171117

11181118
resp = client.get(
11191119
'/deposits/{}'.format(deposit['_deposit']['id']),
@@ -1127,8 +1127,8 @@ def test_get_deposit_when_other_member_of_collaboration_returns_403(
11271127
def test_get_deposit_when_user_has_read_or_admin_acces_can_see_deposit(
11281128
action, client, users, auth_headers_for_user, create_deposit
11291129
):
1130-
user, other_user = users['alice_user'], users['alice_user2']
1131-
deposit = create_deposit(user, 'alice')
1130+
user, other_user = users['atlas_user'], users['atlas_user2']
1131+
deposit = create_deposit(user, 'atlas')
11321132
pid = deposit['_deposit']['id']
11331133
permissions = [
11341134
{'email': other_user.email, 'type': 'user', 'op': 'add', 'action': action}
@@ -1153,9 +1153,10 @@ def test_get_deposit_when_user_has_read_or_admin_acces_can_see_deposit(
11531153
def test_get_deposit_when_user_is_member_of_egroup_with_read_or_admin_acces_can_see_deposit(
11541154
action, client, users, auth_headers_for_user, create_deposit
11551155
):
1156-
user, other_user = users['alice_user'], users['lhcb_user']
1156+
user = users['atlas_user']
1157+
other_user = users['lhcb_user']
11571158
add_role_to_user(other_user, '[email protected]')
1158-
deposit = create_deposit(user, 'alice')
1159+
deposit = create_deposit(user, 'atlas')
11591160
pid = deposit['_deposit']['id']
11601161
permissions = [
11611162
{

tests/integration/schemas/test_schemas_views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,8 @@ def test_patch_notifications_config(
18671867
headers=json_headers + auth_headers_for_user(owner),
18681868
)
18691869
assert resp.status_code == 400
1870-
assert resp.json['message'] == 'Could not apply json-patch to object: string indices must be integers'
1870+
assert resp.json['message'] == ('Could not apply json-patch to object: '
1871+
'Document is expected to be sequence of operations, got a sequence of strings.')
18711872

18721873

18731874
def test_post_notifications_config(

0 commit comments

Comments
 (0)