Skip to content

Commit

Permalink
#150: Modify existing test to actually point to an update by ID endp…
Browse files Browse the repository at this point in the history
…oint

- I got the function names mixed up when originally doing that function...
  • Loading branch information
MRichards99 committed Nov 24, 2020
1 parent 510943e commit 6477491
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/icat/test_standard_endpoints.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest

from datagateway_api.common.exceptions import BadRequestError
from datagateway_api.src.main import api
from datagateway_api.src.main import app
from datagateway_api.src.resources.entities.entity_map import endpoints
Expand Down Expand Up @@ -249,17 +248,18 @@ def test_valid_update_with_id(
expected_summary = "Test Summary"

update_data_json = {
"id": single_investigation_test_data[0]["id"],
"doi": expected_doi,
"summary": expected_summary,
}
single_investigation_test_data[0]["doi"] = expected_doi
single_investigation_test_data[0]["summary"] = expected_summary

test_response = flask_test_app.patch(
"/investigations", headers=valid_credentials_header, json=update_data_json,
f"/investigations/{single_investigation_test_data[0]['id']}",
headers=valid_credentials_header,
json=update_data_json,
)
response_json = prepare_icat_data_for_assertion(test_response.json)
response_json = prepare_icat_data_for_assertion([test_response.json])

assert response_json == single_investigation_test_data

Expand Down

0 comments on commit 6477491

Please sign in to comment.