Skip to content

Commit

Permalink
add tests for self link
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff committed Aug 8, 2024
1 parent 9b916bd commit 2e4e47d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api_tests/preprints/views/test_preprint_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ def test_return_affiliated_institutions(self, app, user, preprint, institution,
assert res.status_code == 200
relationship_link = res.json['data']['relationships']['affiliated_institutions']['links']['related']['href']
assert f'/v2/preprints/{preprint._id}/institutions/' in relationship_link
relationship_link = res.json['data']['relationships']['affiliated_institutions']['links']['self']['href']
assert f'/v2/preprints/{preprint._id}/relationships/institutions/' in relationship_link


@pytest.mark.django_db
Expand Down
3 changes: 2 additions & 1 deletion api_tests/preprints/views/test_preprint_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ def test_return_affiliated_institutions(self):
assert res.content_type == 'application/vnd.api+json'
relationship_link = res.json['data'][0]['relationships']['affiliated_institutions']['links']['related']['href']
assert f'/v2/preprints/{self.preprint._id}/institutions/' in relationship_link

relationship_link = res.json['data'][0]['relationships']['affiliated_institutions']['links']['self']['href']
assert f'/v2/preprints/{self.preprint._id}/relationships/institutions/' in relationship_link

class TestPreprintsListFiltering(PreprintsListFilteringMixin):

Expand Down

0 comments on commit 2e4e47d

Please sign in to comment.