From acfa0fdb15eff617c65b70f5b3e5ec30a900a42c Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 9 Oct 2023 08:55:23 +0200 Subject: [PATCH] [FIX] tests --- tests/test_invoicing.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/test_invoicing.py b/tests/test_invoicing.py index 7548f5f..b2bb666 100644 --- a/tests/test_invoicing.py +++ b/tests/test_invoicing.py @@ -7,10 +7,7 @@ from chift.openapi.models import Consumer -def test_contact(evoliz_consumer: Consumer): - consumer = evoliz_consumer - - # create contact +def create_contact(consumer: Consumer): name = str(uuid.uuid1()) data = { "first_name": name, @@ -24,7 +21,13 @@ def test_contact(evoliz_consumer: Consumer): } ], } - expected_contact = consumer.invoicing.Contact.create(data) + return consumer.invoicing.Contact.create(data) + + +def test_contact(evoliz_consumer: Consumer): + consumer = evoliz_consumer + + expected_contact = create_contact(consumer) assert expected_contact.id, "create() failed" @@ -49,9 +52,7 @@ def test_invoice(evoliz_consumer: Consumer): consumer = evoliz_consumer # find contact required in invoice - contact = consumer.invoicing.Contact.all( - limit=1, params={"contact_type": "customer"} - )[0] + contact = create_contact(consumer) # create invoice data = {