Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marySalvi authored and mvandenburgh committed Jul 23, 2024
1 parent 39d9996 commit 5919308
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion dandiapi/api/tests/test_dandiset.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,7 @@ def test_dandiset_rest_get_owners(api_client, dandiset, social_account):
{
'username': social_account.extra_data['login'],
'name': social_account.extra_data['name'],
'email': None,
}
]

Expand All @@ -836,7 +837,13 @@ def test_dandiset_rest_get_owners_no_social_account(api_client, dandiset, user):
resp = api_client.get(f'/api/dandisets/{dandiset.identifier}/users/')

assert resp.status_code == 200
assert resp.data == [{'username': user.username, 'name': f'{user.first_name} {user.last_name}'}]
assert resp.data == [
{
'username': user.username,
'name': f'{user.first_name} {user.last_name}',
'email': None,
}
]


@pytest.mark.parametrize(
Expand Down Expand Up @@ -871,6 +878,7 @@ def test_dandiset_rest_change_owner(
{
'username': social_account2.extra_data['login'],
'name': social_account2.extra_data['name'],
'email': social_account2.extra_data['email'],
}
]
assert list(dandiset.owners) == [user2]
Expand Down Expand Up @@ -943,10 +951,12 @@ def test_dandiset_rest_add_owner(
{
'username': social_account1.extra_data['login'],
'name': social_account1.extra_data['name'],
'email': social_account1.extra_data['email'],
},
{
'username': social_account2.extra_data['login'],
'name': social_account2.extra_data['name'],
'email': social_account2.extra_data['email'],
},
]
assert list(dandiset.owners) == [user1, user2]
Expand Down Expand Up @@ -983,6 +993,7 @@ def test_dandiset_rest_remove_owner(
{
'username': social_account1.extra_data['login'],
'name': social_account1.extra_data['name'],
'email': social_account1.extra_data['email'],
}
]
assert list(dandiset.owners) == [user1]
Expand Down

0 comments on commit 5919308

Please sign in to comment.