Commit bdcd2dfa455bdae5c2ec7b4a80fe95a20df766c9
1 parent
227bdf7c
passed intervals to initial data as arguments
Showing
1 changed file
with
7 additions
and
120 deletions
... | ... | @@ -82,6 +82,7 @@ def test_tender_data(period_interval=2): |
82 | 82 | } |
83 | 83 | ], |
84 | 84 | "enquiryPeriod": { |
85 | + "startDate": (now).isoformat(), | |
85 | 86 | "endDate": (now + timedelta(minutes=1)).isoformat() |
86 | 87 | }, |
87 | 88 | "tenderPeriod": { |
... | ... | @@ -175,129 +176,13 @@ def prom_test_tender_data(): |
175 | 176 | } |
176 | 177 | } |
177 | 178 | |
178 | -def test_tender_data_multiple_lots1(): | |
179 | +def test_tender_data_multiple_lots(period_interval=2): | |
179 | 180 | now = datetime.now() |
180 | 181 | return { |
181 | 182 | "title": fake.catch_phrase(), |
182 | 183 | "mode": "test", |
183 | 184 | "submissionMethodDetails": "quick", |
184 | - "description": "Тестовий тендер", | |
185 | - "description_en": "Test tender", | |
186 | - "description_ru": "Тестовый тендер", | |
187 | - "procuringEntity": { | |
188 | - "name": fake.company(), | |
189 | - "name_ru": fake_ru.company(), | |
190 | - "name_en": fake_en.company(), | |
191 | - "identifier": { | |
192 | - "scheme": u"UA-EDR", | |
193 | - "id": u"0000{}".format(fake.pyint()), | |
194 | - "uri": fake.image_url(width=None, height=None) | |
195 | - }, | |
196 | - "address": { | |
197 | - "countryName": u"Україна", | |
198 | - "postalCode": fake.postalcode(), | |
199 | - "region": u"м. Київ", | |
200 | - "locality": u"м. Київ", | |
201 | - "streetAddress": fake.street_address() | |
202 | - }, | |
203 | - "contactPoint": { | |
204 | - "name": fake.name(), | |
205 | - "telephone": fake.phone_number() | |
206 | - } | |
207 | - }, | |
208 | - "value": { | |
209 | - "amount": 50000.99, | |
210 | - "currency": u"UAH" | |
211 | - }, | |
212 | - "minimalStep": { | |
213 | - "amount": 100.1, | |
214 | - "currency": u"UAH" | |
215 | - }, | |
216 | - "items": [ | |
217 | - { | |
218 | - "description": fake.catch_phrase(), | |
219 | - "deliveryDate": { | |
220 | - "endDate": (now + timedelta(days=5)).isoformat() | |
221 | - }, | |
222 | - "deliveryLocation": { | |
223 | - "latitude": 49.8500, | |
224 | - "longitude": 24.0167 | |
225 | - }, | |
226 | - "deliveryAddress": { | |
227 | - "countryName": u"Україна", | |
228 | - "postalCode": fake.postalcode(), | |
229 | - "region": u"м. Київ", | |
230 | - "locality": u"м. Київ", | |
231 | - "streetAddress": fake.street_address() | |
232 | - }, | |
233 | - "classification": { | |
234 | - "scheme": u"CPV", | |
235 | - "id": u"44617100-9", | |
236 | - "description": u"Cartons" | |
237 | - }, | |
238 | - "additionalClassifications": [ | |
239 | - { | |
240 | - "scheme": u"ДКПП", | |
241 | - "id": u"17.21.1", | |
242 | - "description": u"папір і картон гофровані, паперова й картонна тара" | |
243 | - } | |
244 | - ], | |
245 | - "unit": { | |
246 | - "name": u"кілограм", | |
247 | - "code": u"KGM" | |
248 | - }, | |
249 | - "quantity": fake.pyint() | |
250 | - }, | |
251 | - { | |
252 | - "description": fake.catch_phrase(), | |
253 | - "deliveryDate": { | |
254 | - "endDate": (now + timedelta(days=5)).isoformat() | |
255 | - }, | |
256 | - "deliveryLocation": { | |
257 | - "latitude": 49.8500, | |
258 | - "longitude": 24.0167 | |
259 | - }, | |
260 | - "deliveryAddress": { | |
261 | - "countryName": u"Україна", | |
262 | - "postalCode": fake.postalcode(), | |
263 | - "region": u"м. Київ", | |
264 | - "locality": u"м. Київ", | |
265 | - "streetAddress": fake.street_address() | |
266 | - }, | |
267 | - "classification": { | |
268 | - "scheme": u"CPV", | |
269 | - "id": u"44617100-9", | |
270 | - "description": u"Cartons" | |
271 | - }, | |
272 | - "additionalClassifications": [ | |
273 | - { | |
274 | - "scheme": u"ДКПП", | |
275 | - "id": u"17.21.1", | |
276 | - "description": u"картон гофровані, паперова й картонна тара" | |
277 | - } | |
278 | - ], | |
279 | - "unit": { | |
280 | - "name": u"кілограм", | |
281 | - "code": u"KGM" | |
282 | - }, | |
283 | - "quantity": fake.pyint() | |
284 | - } | |
285 | - ], | |
286 | - "enquiryPeriod": { | |
287 | - "endDate": (now + timedelta(minutes=2)).isoformat() | |
288 | - }, | |
289 | - "tenderPeriod": { | |
290 | - "endDate": (now + timedelta(minutes=5)).isoformat() | |
291 | - } | |
292 | -} | |
293 | - | |
294 | -def test_tender_data_multiple_lots(): | |
295 | - now = datetime.now() | |
296 | - return { | |
297 | - "title": fake.catch_phrase(), | |
298 | - "mode": "test", | |
299 | - "submissionMethodDetails": "quick", | |
300 | - "description": "Тестовий тендер", | |
185 | + "description": u"Тестовий тендер", | |
301 | 186 | "description_en": "Test tender", |
302 | 187 | "description_ru": "Тестовый тендер", |
303 | 188 | "procuringEntity": { |
... | ... | @@ -468,10 +353,12 @@ def test_tender_data_multiple_lots(): |
468 | 353 | } |
469 | 354 | ], |
470 | 355 | "enquiryPeriod": { |
471 | - "endDate": (now + timedelta(minutes=120)).isoformat() | |
356 | + "startDate": (now).isoformat(), | |
357 | + "endDate": (now + timedelta(minutes=1)).isoformat() | |
472 | 358 | }, |
473 | 359 | "tenderPeriod": { |
474 | - "endDate": (now + timedelta(minutes=120)).isoformat() | |
360 | + "startDate": (now + timedelta(minutes=2)).isoformat(), | |
361 | + "endDate": (now + timedelta(minutes=(2+period_interval))).isoformat() | |
475 | 362 | } |
476 | 363 | } |
477 | 364 | ... | ... |
Please
register
or
login
to post a comment