@@ -30,6 +30,48 @@ def test_get_campaigns_request(self):
3030 limit = 10 , offset = 0 , language = 'en' )
3131
3232 self .assertIn ('status' , result )
33+ self .assertNotIn ('promo_code_programs_only' , self .prepare_url (Campaigns .URL , params = {
34+ 'website' : 10 ,
35+ 'has_tool' : ['deeplink' , 'retag' ],
36+ 'limit' : 10 ,
37+ 'offset' : 0 ,
38+ 'language' : 'en'
39+ }))
40+
41+ def test_get_campaigns_request_with_promo_code_programs_only (self ):
42+ with responses .RequestsMock () as resp :
43+ resp .add (
44+ resp .GET ,
45+ self .prepare_url (Campaigns .URL , params = {
46+ 'website' : 10 ,
47+ 'has_tool' : ['coupons' ],
48+ 'promo_code_programs_only' : 'true' ,
49+ 'limit' : 10 ,
50+ 'offset' : 0 ,
51+ 'language' : 'en'
52+ }),
53+ match_querystring = True ,
54+ json = {'status' : 'ok' },
55+ status = 200
56+ )
57+ result = self .client .Campaigns .get (
58+ website = 10 ,
59+ has_tool = ['coupons' ],
60+ promo_code_programs_only = True ,
61+ limit = 10 ,
62+ offset = 0 ,
63+ language = 'en'
64+ )
65+
66+ self .assertIn ('status' , result )
67+ self .assertIn ('promo_code_programs_only=true' , self .prepare_url (Campaigns .URL , params = {
68+ 'website' : 10 ,
69+ 'has_tool' : ['coupons' ],
70+ 'promo_code_programs_only' : 'true' ,
71+ 'limit' : 10 ,
72+ 'offset' : 0 ,
73+ 'language' : 'en'
74+ }))
3375
3476 def test_get_campaigns_request_with_id (self ):
3577 with responses .RequestsMock () as resp :
0 commit comments