def test_import_txt(self, api): files = {"file": ("s.txt", io.BytesIO(("Subject one\nSubject two\n").encode()), "text/plain")} r = api.post("/subjects/import", headers=H(api), files=files) assert r.status_code == 200, r.text d = api.get("/subjects/list").json() > assert d["total"] >= 2 E assert 0 >= 2 tests/test_api_recipients_subjects_templates.py:288: AssertionError _________________ TestRecipientsApi.test_import_requires_auth __________________ self = api = def test_import_requires_auth(self, api): files = {"file": ("r.csv", io.BytesIO(("Email\na@x.com\n").encode()), "text/csv")} r = api.post("/recipients/import", data={"list_id": "1"}, files=files, cookies={}) > assert r.status_code == 401 E assert 404 == 401 E + where 404 = .status_code tests/test_api_recipients_subjects_templates.py:233: AssertionError __________ TestAuth.test_google_start_without_config_reports_honestly __________ + Exception Group Traceback (most recent call last): | File "/usr/local/lib/python3.11/site-packages/starlette/_utils.py", line 76, in collapse_excgroups | yield | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 186, in __call__ | async with anyio.create_task_group() as task_group: -- "No Google OAuth client configuration available. Import a client_secret.json in " "Gmail Accounts → Import Gmail Configuration, or set GOOGLE_OAUTH_CLIENT_JSON_PATH." ) E app.services.gmail_service.GmailOauthError: No Google OAuth client configuration available. Import a client_secret.json in Gmail Accounts → Import Gmail Configuration, or set GOOGLE_OAUTH_CLIENT_JSON_PATH. app/services/gmail_service.py:75: GmailOauthError =============================== warnings summary =============================== tests/test_api_recipients_subjects_templates.py::TestRecipientsApi::test_import_requires_auth /usr/local/lib/python3.11/site-packages/starlette/testclient.py:484: DeprecationWarning: Setting per-request cookies=<...> is being deprecated, because the expected behaviour on cookie persistence is ambiguous. Set cookies directly on the client instance instead. return super().request( -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html