Page MenuHomeSoftware Heritage

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

TEST RESULT

Run At
Feb 24 2022, 10:00 AM
Details
authenticated_client = <rest_framework.test.APIClient object at 0x7f021c8c4a58> deposit_collection = <DepositCollection: {'id': 13, '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', ...} sample_archive = {'data': b'PK\x03\x04\x14\x00\x00\x00\x00\x00\xb7FXT\xcba\xb4c\x14\x00\x00\x00\x14\x00\x00\x00\x05\x00\x00\x00file1som...ytest-0/test_add_deposit_add_to_wrong_0/tmpgcqoiasf', 'length': 128, 'md5sum': '3b72f1e3327301c321757c04bb227005', ...} def test_add_deposit_add_to_wrong_origin( authenticated_client, deposit_collection, atom_dataset, sample_archive, ): """Posting a deposit with an <swh:add_to_origin> referencing an origin not starting with the provider_url raises an error """ origin_url = "http://example.org/foo" # adding a new deposit with the same external id as a completed deposit response = post_atom( authenticated_client, reverse(COL_IRI, args=[deposit_collection.name]), data=atom_dataset["entry-data0"] % origin_url, ) > assert response.status_code == status.HTTP_403_FORBIDDEN, response.content.decode() E AssertionError: <?xml version="1.0" encoding="utf-8"?> E <sword:error xmlns="http://www.w3.org/2005/Atom" E xmlns:sword="http://purl.org/net/sword/terms/"> E <summary>Malformed xml metadata</summary> E <sword:treatment>processing failed</sword:treatment> E E <sword:verboseDescription> E The xml received is malformed. Please ensure your metadata file is correctly formatted. E </sword:verboseDescription> E E </sword:error> E E assert 400 == 403 E +400 E -403 .tox/py3/lib/python3.7/site-packages/swh/deposit/tests/api/test_collection_add_to_origin.py:108: AssertionError