From 84027156fd97dcb68f0c542dc54dc8598e76c820 Mon Sep 17 00:00:00 2001 From: Daniel Herrmann Date: Thu, 5 Sep 2024 13:41:11 +0200 Subject: [PATCH] fix EV tests based on current set of default example data --- tests/test_contact_details.py | 6 +++--- tests/test_filters.py | 4 ++-- tests/test_member.py | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/test_contact_details.py b/tests/test_contact_details.py index 8001c41..bec97c4 100644 --- a/tests/test_contact_details.py +++ b/tests/test_contact_details.py @@ -8,9 +8,9 @@ def test_get_contact_details(self, ev_connection: EasyvereinAPI): # Check if the response is a list assert isinstance(contact_details, list) - # We should have 6 invoices based on the example data - assert total_count == 10 - assert len(contact_details) == 10 + # We should have contacts based on the example data + assert total_count == 8 + assert len(contact_details) == 8 # Check if all the members are of type Member for contact_detail in contact_details: diff --git a/tests/test_filters.py b/tests/test_filters.py index dac6f4b..3ee1916 100644 --- a/tests/test_filters.py +++ b/tests/test_filters.py @@ -24,7 +24,7 @@ def validate_response(response: tuple[list[Any], int], model: type, num_expected assert isinstance(instance, model) def test_filter_invoices(self, ev_connection: EasyvereinAPI): - search = InvoiceFilter(invNumber__in=["10", "11"], canceledInvoice__isnull=True, isDraft=False) + search = InvoiceFilter(invNumber__in=["32", "33"], canceledInvoice__isnull=True, isDraft=False) TestFilter.validate_response(ev_connection.invoice.get(search=search), Invoice, 2) @@ -39,7 +39,7 @@ def test_filter_members(self, ev_connection: EasyvereinAPI): # Case 3: search by name search = MemberFilter(search="Mustermann") - TestFilter.validate_response(ev_connection.member.get(search=search), Member, 2) + TestFilter.validate_response(ev_connection.member.get(search=search), Member, 1) # Case 4: test bool, get chairmans search = MemberFilter(isChairman=True) diff --git a/tests/test_member.py b/tests/test_member.py index a6e1368..1432899 100644 --- a/tests/test_member.py +++ b/tests/test_member.py @@ -11,10 +11,10 @@ def test_get_members(self, ev_connection: EasyvereinAPI): # Check if the response is a list assert isinstance(members, list) - # We should have 8 members based on the example data - # 5 regular members, 3 requests - assert total_count == 8 - assert len(members) == 8 + # We should have 5 members based on the example data + # 4 regular members, 1 requests + assert total_count == 5 + assert len(members) == 5 # Check if all the members are of type Member for member in members: @@ -28,7 +28,7 @@ def test_members_with_query(self, ev_connection: EasyvereinAPI): members, total_count = ev_connection.member.get(query=query, limit=2) assert len(members) == 2 - assert total_count == 8 + assert total_count == 5 for member in members: assert isinstance(member, Member)