Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion integration_tests/ads/test_ad_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_update_fail_with_invalid_tracking_urls(self):
tracking_urls=new_tracking_url
)

with self.assertRaises((AssertionError, ApiException)):
with self.assertRaises(ApiException):
ad_group.update_fields(**update_argument)


Expand Down
3 changes: 3 additions & 0 deletions integration_tests/ads/test_campaigns.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ def test_create_campaign_failure_without_budget(self):
"""
Verify a new Campaign response failure and catching exceptions
"""
# This ad account requires Campaign Budget Optimization, so CBO must be on;
# with CBO on and no spend cap the API reports the missing-budget error 2384
# (CBO campaigns need [lifetime_spend_cap and end_time] or daily_spend_cap).
campaign_arguments = dict(
client=self.test_client,
ad_account_id=DEFAULT_AD_ACCOUNT_ID,
Expand Down
3 changes: 1 addition & 2 deletions integration_tests/ads/test_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from integration_tests.config import DEFAULT_AD_ACCOUNT_ID

from pinterest.ads.keywords import Keyword
from pinterest.utils.sdk_exceptions import SdkException

from openapi_generated.pinterest_client.exceptions import ApiException
from openapi_generated.pinterest_client.model.match_type_response import MatchTypeResponse
Expand Down Expand Up @@ -49,7 +48,7 @@ def test_create_fail_without_matchtype(self):
value="string",
)

with self.assertRaises((SdkException, ApiException)):
with self.assertRaises(ApiException):
Keyword.create(**keyword_arguments)


Expand Down
4 changes: 4 additions & 0 deletions integration_tests/utils/ads_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def __init__(self, client=None):
name="SDK Test Campaign",
objective_type="AWARENESS",
daily_spend_cap=10000000,
# This ad account requires Campaign Budget Optimization (ad-group level
# budgets are not allowed), so budgets must be set at the campaign level.
is_campaign_budget_optimization=True,
)
self.campaign_id = self.campaign._id
Expand All @@ -126,6 +128,8 @@ def get_default_params(self):
name="SDK Test Campaign",
objective_type="AWARENESS",
daily_spend_cap=10000000,
# This ad account requires Campaign Budget Optimization (ad-group level
# budgets are not allowed), so budgets must be set at the campaign level.
is_campaign_budget_optimization=True,
)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Pinterest-Generated-Client==0.1.11
Pinterest-Generated-Client==0.1.12
python-dateutil==2.8.2
six==1.16.0
urllib3>=1.26.12
Expand Down
Loading