@@ -19,7 +19,7 @@ def _create_additional_promo(self):
19
19
'promo_common' : 'special-10' ,
20
20
}
21
21
response_create = self .client .post (
22
- self .promo_create_url ,
22
+ self .promo_list_create_url ,
23
23
self .__class__ .promo5_data ,
24
24
format = 'json' ,
25
25
)
@@ -99,7 +99,7 @@ def setUp(self):
99
99
)
100
100
101
101
def test_get_all_promos (self ):
102
- response = self .client .get (self .promo_list_url )
102
+ response = self .client .get (self .promo_list_create_url )
103
103
self .assertEqual (
104
104
response .status_code ,
105
105
rest_framework .status .HTTP_200_OK ,
@@ -113,7 +113,7 @@ def test_get_all_promos(self):
113
113
self .assertEqual (response .headers .get ('X-Total-Count' ), '3' )
114
114
115
115
def test_get_promos_with_pagination_offset_1 (self ):
116
- response = self .client .get (self .promo_list_url , {'offset' : 1 })
116
+ response = self .client .get (self .promo_list_create_url , {'offset' : 1 })
117
117
self .assertEqual (
118
118
response .status_code ,
119
119
rest_framework .status .HTTP_200_OK ,
@@ -127,7 +127,7 @@ def test_get_promos_with_pagination_offset_1(self):
127
127
128
128
def test_get_promos_with_pagination_offset_1_limit_1 (self ):
129
129
response = self .client .get (
130
- self .promo_list_url ,
130
+ self .promo_list_create_url ,
131
131
{'offset' : 1 , 'limit' : 1 },
132
132
)
133
133
self .assertEqual (
@@ -140,7 +140,7 @@ def test_get_promos_with_pagination_offset_1_limit_1(self):
140
140
self .assertEqual (response .get ('X-Total-Count' ), '3' )
141
141
142
142
def test_get_promos_with_pagination_offset_100 (self ):
143
- response = self .client .get (self .promo_list_url , {'offset' : 100 })
143
+ response = self .client .get (self .promo_list_create_url , {'offset' : 100 })
144
144
self .assertEqual (
145
145
response .status_code ,
146
146
rest_framework .status .HTTP_200_OK ,
@@ -150,7 +150,10 @@ def test_get_promos_with_pagination_offset_100(self):
150
150
self .assertEqual (response .get ('X-Total-Count' ), '3' )
151
151
152
152
def test_get_promos_filter_country_gb (self ):
153
- response = self .client .get (self .promo_list_url , {'country' : 'gb' })
153
+ response = self .client .get (
154
+ self .promo_list_create_url ,
155
+ {'country' : 'gb' },
156
+ )
154
157
self .assertEqual (
155
158
response .status_code ,
156
159
rest_framework .status .HTTP_200_OK ,
@@ -164,7 +167,7 @@ def test_get_promos_filter_country_gb(self):
164
167
165
168
def test_get_promos_filter_country_gb_sort_active_until (self ):
166
169
response = self .client .get (
167
- self .promo_list_url ,
170
+ self .promo_list_create_url ,
168
171
{'country' : 'gb' , 'sort_by' : 'active_until' },
169
172
)
170
173
self .assertEqual (
@@ -180,7 +183,7 @@ def test_get_promos_filter_country_gb_sort_active_until(self):
180
183
181
184
def test_get_promos_filter_country_gb_fr_sort_active_from_limit_10 (self ):
182
185
response = self .client .get (
183
- self .promo_list_url ,
186
+ self .promo_list_create_url ,
184
187
{'country' : 'gb,FR' , 'sort_by' : 'active_from' , 'limit' : 10 },
185
188
)
186
189
self .assertEqual (
@@ -199,7 +202,7 @@ def test_get_promos_filter_country_gb_fr_sort_active_from_limit_2_offset_2(
199
202
self ,
200
203
):
201
204
response = self .client .get (
202
- self .promo_list_url ,
205
+ self .promo_list_create_url ,
203
206
{
204
207
'country' : 'gb,FR' ,
205
208
'sort_by' : 'active_from' ,
@@ -218,7 +221,7 @@ def test_get_promos_filter_country_gb_fr_sort_active_from_limit_2_offset_2(
218
221
219
222
def test_get_promos_filter_country_gb_fr_us_sort_active_from_limit_2 (self ):
220
223
response = self .client .get (
221
- self .promo_list_url ,
224
+ self .promo_list_create_url ,
222
225
{'country' : 'gb,FR,us' , 'sort_by' : 'active_from' , 'limit' : 2 },
223
226
)
224
227
self .assertEqual (
@@ -233,7 +236,7 @@ def test_get_promos_filter_country_gb_fr_us_sort_active_from_limit_2(self):
233
236
self .assertEqual (response .get ('X-Total-Count' ), '3' )
234
237
235
238
def test_get_promos_limit_zero (self ):
236
- response = self .client .get (self .promo_list_url , {'limit' : 0 })
239
+ response = self .client .get (self .promo_list_create_url , {'limit' : 0 })
237
240
self .assertEqual (
238
241
response .status_code ,
239
242
rest_framework .status .HTTP_200_OK ,
@@ -245,7 +248,7 @@ def test_create_and_get_promos(self):
245
248
self ._create_additional_promo ()
246
249
247
250
response_list = self .client .get (
248
- self .promo_list_url ,
251
+ self .promo_list_create_url ,
249
252
{'country' : 'gb,FR,Kz' , 'sort_by' : 'active_from' , 'limit' : 10 },
250
253
)
251
254
self .assertEqual (
@@ -260,7 +263,7 @@ def test_create_and_get_promos(self):
260
263
def test_get_promos_filter_gb_kz_fr (self ):
261
264
self ._create_additional_promo ()
262
265
response = self .client .get (
263
- self .promo_list_url ,
266
+ self .promo_list_create_url ,
264
267
{'country' : 'gb,Kz,FR' , 'sort_by' : 'active_from' , 'limit' : 10 },
265
268
)
266
269
self .assertEqual (
@@ -275,7 +278,7 @@ def test_get_promos_filter_gb_kz_fr(self):
275
278
def test_get_promos_filter_kz_sort_active_until (self ):
276
279
self ._create_additional_promo ()
277
280
response = self .client .get (
278
- self .promo_list_url ,
281
+ self .promo_list_create_url ,
279
282
{'country' : 'Kz' , 'sort_by' : 'active_until' , 'limit' : 10 },
280
283
)
281
284
self .assertEqual (
@@ -300,7 +303,7 @@ def test_country_parameter_formats(self, _, params, expected_count):
300
303
'limit' : 10 ,
301
304
}
302
305
303
- response = self .client .get (self .promo_list_url , full_params )
306
+ response = self .client .get (self .promo_list_create_url , full_params )
304
307
self .assertEqual (
305
308
response .status_code ,
306
309
rest_framework .status .HTTP_200_OK ,
0 commit comments