partial_deposit = <Deposit: {'id': 40, 'reception_date': datetime.datetime(2020, 11, 18, 12, 12, 6, 232463, tzinfo=<UTC>), 'collection': 'test', 'external_id': 'external-id-partial', 'client': 'test', 'status': 'partial'}>
deposited_deposit = <Deposit: {'id': 41, 'reception_date': datetime.datetime(2020, 11, 18, 12, 12, 6, 301784, tzinfo=<UTC>), 'collection': 'test', 'external_id': 'external-id-deposited', 'client': 'test', 'status': 'deposited'}>
authenticated_client = <rest_framework.test.APIClient object at 0x7fdc22b6c320>
def test_deposit_list_exclude(partial_deposit, deposited_deposit, authenticated_client):
"""Exclusion pattern on external_id should be respected
"""
partial_deposit.status_detail = STATUS_DETAIL
partial_deposit.save()
main_url = reverse(PRIVATE_LIST_DEPOSITS)
# Testing exclusion pattern
exclude_pattern = "external-id"
assert partial_deposit.external_id.startswith(exclude_pattern)
assert deposited_deposit.external_id.startswith(exclude_pattern)
url = f"{main_url}?page_size=1&exclude=external-id"
response = authenticated_client.get(url)
> assert response.status_code == status.HTTP_200_OK
E assert 405 == 200
E +405
E -200
.tox/py3/lib/python3.7/site-packages/swh/deposit/tests/api/test_deposit_list.py:92: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Nov 18 2020, 1:13 PM