Commit efe60708f6c8f28dd6970c56228fc8caec85630b
1 parent
15bb91a5
Shorten test_tender_data_multiple_lots
This reduces unnecessary duplication of code.
Showing
1 changed file
with
5 additions
and
48 deletions
@@ -214,44 +214,8 @@ def prom_test_tender_data(): | @@ -214,44 +214,8 @@ def prom_test_tender_data(): | ||
214 | 214 | ||
215 | def test_tender_data_multiple_lots(period_interval): | 215 | def test_tender_data_multiple_lots(period_interval): |
216 | now = get_now() | 216 | now = get_now() |
217 | - return { | ||
218 | - "title": fake.catch_phrase(), | ||
219 | - "mode": "test", | ||
220 | - "submissionMethodDetails": "quick", | ||
221 | - "description": u"Тестовий тендер", | ||
222 | - "description_ru": u"Тестовый тендер", | ||
223 | - "description_en": "Test tender", | ||
224 | - "procuringEntity": { | ||
225 | - "name": fake.company(), | ||
226 | - "name_ru": fake_ru.company(), | ||
227 | - "name_en": fake_en.company(), | ||
228 | - "identifier": { | ||
229 | - "scheme": u"UA-EDR", | ||
230 | - "id": u"0000{}".format(fake.pyint()), | ||
231 | - "uri": fake.image_url(width=None, height=None) | ||
232 | - }, | ||
233 | - "address": { | ||
234 | - "countryName": u"Україна", | ||
235 | - "countryName_ru": u"Украина", | ||
236 | - "countryName_en": "Ukraine", | ||
237 | - "postalCode": fake.postalcode(), | ||
238 | - "region": u"м. Київ", | ||
239 | - "locality": u"м. Київ", | ||
240 | - "streetAddress": fake.street_address() | ||
241 | - }, | ||
242 | - "contactPoint": { | ||
243 | - "name": fake.name(), | ||
244 | - "telephone": fake.phone_number() | ||
245 | - } | ||
246 | - }, | ||
247 | - "value": { | ||
248 | - "amount": 50000.99, | ||
249 | - "currency": u"UAH" | ||
250 | - }, | ||
251 | - "minimalStep": { | ||
252 | - "amount": 100.1, | ||
253 | - "currency": u"UAH" | ||
254 | - }, | 217 | + t_data = test_tender_data(period_interval) |
218 | + t_data.update({ | ||
255 | "items": [ | 219 | "items": [ |
256 | { | 220 | { |
257 | "description": fake.catch_phrase(), | 221 | "description": fake.catch_phrase(), |
@@ -413,16 +377,9 @@ def test_tender_data_multiple_lots(period_interval): | @@ -413,16 +377,9 @@ def test_tender_data_multiple_lots(period_interval): | ||
413 | }, | 377 | }, |
414 | "quantity": fake.pyint() | 378 | "quantity": fake.pyint() |
415 | } | 379 | } |
416 | - ], | ||
417 | - "enquiryPeriod": { | ||
418 | - "startDate": (now).isoformat(), | ||
419 | - "endDate": (now + timedelta(minutes=1)).isoformat() | ||
420 | - }, | ||
421 | - "tenderPeriod": { | ||
422 | - "startDate": (now + timedelta(minutes=2)).isoformat(), | ||
423 | - "endDate": (now + timedelta(minutes=(2 + period_interval))).isoformat() | ||
424 | - } | ||
425 | - } | 380 | + ] |
381 | + }) | ||
382 | + return t_data | ||
426 | 383 | ||
427 | 384 | ||
428 | def test_question_data(): | 385 | def test_question_data(): |
Please
register
or
login
to post a comment