diff --git a/integration_tests/ads/test_ad_groups.py b/integration_tests/ads/test_ad_groups.py index 25929b0..4ad6dde 100644 --- a/integration_tests/ads/test_ad_groups.py +++ b/integration_tests/ads/test_ad_groups.py @@ -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) diff --git a/integration_tests/ads/test_campaigns.py b/integration_tests/ads/test_campaigns.py index 095cb32..bb5fd52 100644 --- a/integration_tests/ads/test_campaigns.py +++ b/integration_tests/ads/test_campaigns.py @@ -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, diff --git a/integration_tests/ads/test_keywords.py b/integration_tests/ads/test_keywords.py index 701d2bc..000b6c9 100644 --- a/integration_tests/ads/test_keywords.py +++ b/integration_tests/ads/test_keywords.py @@ -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 @@ -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) diff --git a/integration_tests/utils/ads_utils.py b/integration_tests/utils/ads_utils.py index 1fe312c..c627dfe 100644 --- a/integration_tests/utils/ads_utils.py +++ b/integration_tests/utils/ads_utils.py @@ -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 @@ -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, ) diff --git a/requirements.txt b/requirements.txt index e391170..7a7de31 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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