Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.deposit.tests.api.test_deposit_update::test_put_update_metadata_done_deposit_failure_functional_checks
Failed

TEST RESULT

Run At
Oct 12 2020, 2:08 PM
Details
tmp_path = '/tmp/pytest-of-jenkins/pytest-0/test_put_update_metadata_done_4' authenticated_client = <rest_framework.test.APIClient object at 0x7ff8f4fc2e10> complete_deposit = <Deposit: {'id': 76, 'reception_date': datetime.datetime(2020, 10, 12, 12, 7, 50, 23309, tzinfo=<UTC>), 'collection': 'test', 'external_id': 'external-id-complete', 'client': 'test', 'status': 'done'}> deposit_collection = <DepositCollection: {'id': 93, 'name': 'test'}> atom_dataset = {'codemeta-sample': '<?xml version="1.0"?>\n <entry xmlns="http://www.w3.org/2005/Atom"\n xmlns:d...ntry>\n', 'entry-data-empty-body': '<?xml version="1.0"?>\n<entry xmlns="http://www.w3.org/2005/Atom"></entry>\n', ...} swh_storage = <swh.storage.postgresql.storage.Storage object at 0x7ff8f54c5cc0> def test_put_update_metadata_done_deposit_failure_functional_checks( tmp_path, authenticated_client, complete_deposit, deposit_collection, atom_dataset, swh_storage, ): """failure: client updates metadata on deposit done without required incomplete metadata Response: 400 """ update_uri = reverse( EDIT_SE_IRI, args=[deposit_collection.name, complete_deposit.id] ) response = authenticated_client.put( update_uri, content_type="application/atom+xml;type=entry", # no title, nor author, nor name fields data=atom_dataset["entry-data-fail-metadata-functional-checks"], HTTP_X_CHECK_SWHID=complete_deposit.swhid, ) assert response.status_code == status.HTTP_400_BAD_REQUEST assert b"Functional metadata checks failure" in response.content # detail on the errors > assert b"- Mandatory fields are missing (author)" in response.content E assert b'- Mandatory fields are missing (author)' in b'<?xml version="1.0" encoding="utf-8"?>\n<sword:error xmlns="http://www.w3.org/2005/Atom"\n xmlns:sword="http:/...r author, name or title or codemeta:name or codemeta:title)\n\n </sword:verboseDescription>\n \n</sword:error>\n' E + where b'<?xml version="1.0" encoding="utf-8"?>\n<sword:error xmlns="http://www.w3.org/2005/Atom"\n xmlns:sword="http:/...r author, name or title or codemeta:name or codemeta:title)\n\n </sword:verboseDescription>\n \n</sword:error>\n' = <HttpResponse status_code=400, "application/xml">.content .tox/py3/lib/python3.7/site-packages/swh/deposit/tests/api/test_deposit_update.py:802: AssertionError