def test_checkout_needs_new_fetch(monkeypatch, checkout_with_item, address): monkeypatch.setattr("saleor.extensions.plugins.avatax.cache.get", lambda x: None) checkout_with_item.shipping_address = address config = AvataxConfiguration( username_or_account="wrong_data", password_or_license="wrong_data" ) checkout_data = generate_request_data_from_checkout(checkout_with_item, config) assert checkout_needs_new_fetch(checkout_data, str(checkout_with_item.token))
def test_checkout_needs_new_fetch(monkeypatch, settings, checkout_with_item, address): monkeypatch.setattr("saleor.extensions.plugins.avatax.cache.get", lambda x: None) checkout_with_item.shipping_address = address checkout_data = generate_request_data_from_checkout(checkout_with_item) assert checkout_needs_new_fetch(checkout_data, str(checkout_with_item.token))