Skip to content

Commit

Permalink
[DE-1091] Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-nedza committed Dec 12, 2024
1 parent 3797071 commit bd22584
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

BASIC_AUTH_USERNAME = os.getenv("BASIC_AUTH_USERNAME")
BASIC_AUTH_PASSWORD = os.getenv("BASIC_AUTH_PASSWORD")
DOMAIN = os.getenv("DOMAIN")
SUBDOMAIN = os.getenv("SUBDOMAIN")


Expand All @@ -42,15 +41,14 @@ def clean_custom_fields(client: AdvancedBillingClient):
def client() -> AdvancedBillingClient:
client = AdvancedBillingClient(
subdomain=SUBDOMAIN,
domain=DOMAIN,
basic_auth_credentials=BasicAuthCredentials(
username=BASIC_AUTH_USERNAME,
password=BASIC_AUTH_PASSWORD
)
)

clean_custom_fields(client)
client.sites.clear_site()
#client.sites.clear_site()
sleep(10) # Wait for site to be cleared as it takes some time

yield client
Expand All @@ -60,7 +58,6 @@ def client() -> AdvancedBillingClient:
def unauthorized_client() -> AdvancedBillingClient:
return AdvancedBillingClient(
subdomain=SUBDOMAIN,
domain=DOMAIN,
basic_auth_credentials=BasicAuthCredentials(
username="thisiswrongapitokenthisiswrongapitokenV8",
password=BASIC_AUTH_PASSWORD
Expand Down
4 changes: 2 additions & 2 deletions tests/test_invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from advancedbilling.models.coupon import Coupon
from advancedbilling.models.create_customer_request import CreateCustomerRequest
from advancedbilling.models.create_invoice_request import CreateInvoiceRequest
from advancedbilling.models.create_or_update_coupon import CreateOrUpdateCoupon
from advancedbilling.models.coupon_request import CouponRequest
from advancedbilling.models.create_or_update_product_request import (
CreateOrUpdateProductRequest,
)
Expand Down Expand Up @@ -75,7 +75,7 @@ def test_create_invoice_given_subscription_then_return_correct_invoice(
).payment_profile

coupon: Coupon = coupons_controller.create_coupon(
product_family.id, CreateOrUpdateCoupon(InitCases.get_coupon_data())
product_family.id, CouponRequest(InitCases.get_coupon_data())
).coupon

subscription: Subscription = subscriptions_controller.create_subscription(
Expand Down

0 comments on commit bd22584

Please sign in to comment.