Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions tests/test_invoicing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"

Expand All @@ -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 = {
Expand Down