def test_add_promotions_overflow(self):
responses.add_callback(
responses.POST,
'https://api.optimove.net/v3.0/general/login',
callback=login_callback,
content_type='application/json'
)
responses.add_callback(
responses.POST,
'https://api.optimove.net/v3.0/integrations/AddPromotions',
callback=add_promotions_callback,
content_type='application/json'
)
client = Client('username', 'password')
too_much_promotions = {}
for it in range(150):
promo_code = ''.join([random.choice(string.ascii_uppercase + string.digits) for _ in range(5)])
too_much_promotions[promo_code] = promo_code
self.assertRaises(Exception, client.integrations.add_promotions, too_much_promotions)
评论列表
文章目录