"""Integration tests for ows-accounting - statement_attachments""" from tests.integration import conftest from tests.integration.conftest import label_7482, user_headers def test_expected(): """GET /attachments gives list of statement attachments for label_7482.""" expected = ['auto_test_DOC.doc', 'auto_test_DOCX.docx', 'auto_test_JPG.jpg', 'auto_test_PDF.pdf', 'auto_test_PNG.png', 'auto_test_XLS.xls', 'auto_test_XLSX.xlsx'] test_user = label_7482() headers = user_headers( test_user['user_type'], test_user['id'], test_user['vend_contact_id']) params = {'periods': '226,227,228'} ows_accounting_client = conftest.ows_accounting_api_client(headers) results = ows_accounting_client.get_attachments(params) assert results.status_code == 200, \ 'Result of call was {}, expected 200.'.format(results.status_code) json_results = results.json() actual = list( map(lambda i: i['original_file_name'], json_results['items'])) assert set(expected) == set(actual)