From 58a596ad8fac8db5fcd5b038e45ac1974c4811e1 Mon Sep 17 00:00:00 2001 From: Anna Janiszewska Date: Mon, 25 Sep 2023 09:08:04 +0200 Subject: [PATCH] fixup! fixup! fixup! Add test --- pingen/tests/test_pingen.py | 10 ++++++---- test-requirements.txt | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pingen/tests/test_pingen.py b/pingen/tests/test_pingen.py index 8229ada1f78..31d1598fd22 100644 --- a/pingen/tests/test_pingen.py +++ b/pingen/tests/test_pingen.py @@ -178,11 +178,13 @@ def test_pingen_push_document(self): self.company._get_pingen_client() - attachment = self.env["ir.attachment"].search( - [("res_model", "=", "account.move")] - )[0] + attachment = self.env["ir.attachment"].create({ + "name": "in_invoice_yourcompany_demo.pdf", + "datas": base64.b64encode(bytes("", "utf8")), + "type": "binary", + }) attachment.write({"send_to_pingen": True}) - pingen_document = attachment.pingen_document_ids[0] + pingen_document = attachment.pingen_document_ids pingen_document.push_to_pingen() self.assertEqual(pingen_document.state, "pushed") diff --git a/test-requirements.txt b/test-requirements.txt index 9a7ce198f98..2c9c818c27c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,3 +1,3 @@ -vcr +vcrpy requests_mock freezegun