Commit 42cd942810b9dc832b04fa82048f0a7e474f3dc9

Authored by Leits
1 parent ca63d4f7

Add accelerator to all procedure

... ... @@ -25,11 +25,12 @@ Default:
25 25 # Second number in list: Duration of period (for endDate)
26 26 enquiry: [0, 11]
27 27 tender: [0, 31]
28   - openua:
29 28 # accelerator: Integer value
30 29 # This is not a name of period
31 30 # Please refer to API documentation to find out what's this
32 31 accelerator: 1440
  32 + openua:
  33 + accelerator: 1440
33 34 tender: [0, 15]
34 35 # Please remember that openUA and openEU procedures
35 36 # forbid anyone to set or modify enquiryPeriod
... ...
... ... @@ -72,6 +72,9 @@ def test_tender_data(params, periods=("enquiry", "tender")):
72 72 "items": [],
73 73 "features": []
74 74 }
  75 + accelerator = params['intervals']['accelerator']
  76 + data['procurementMethodDetails'] = 'quick, ' \
  77 + 'accelerator={}'.format(accelerator)
75 78 data["procuringEntity"]["kind"] = "other"
76 79 if data.get("mode") == "test":
77 80 data["title"] = u"[ТЕСТУВАННЯ] {}".format(data["title"])
... ... @@ -144,14 +147,12 @@ def test_tender_data_limited(params):
144 147 "stateLegalServices"
145 148 )
146 149 cause = fake.random_element(cause_variants)
147   - data.update({"cause": cause})
148   - if params['mode'] == "negotiation.quick":
  150 + elif params['mode'] == "negotiation.quick":
149 151 cause_variants = ('quick',)
150   - cause = fake.random_element(cause_variants)
151   - data.update({"cause": cause})
152 152 if params['mode'] in ("negotiation", "negotiation.quick"):
  153 + cause = fake.random_element(cause_variants)
153 154 data.update({
154   - "procurementMethodDetails": "quick, accelerator=1440",
  155 + "cause": cause,
155 156 "causeDescription": fake.description()
156 157 })
157 158 return munchify(data)
... ... @@ -350,33 +351,21 @@ def test_lot_document_data(document, lot_id):
350 351
351 352
352 353 def test_tender_data_openua(params):
353   - accelerator = params['intervals']['accelerator']
354   - # Since `accelerator` field is not really a list containing timings
355   - # for a period called `acceleratorPeriod`, let's remove it :)
356   - del params['intervals']['accelerator']
357 354 # We should not provide any values for `enquiryPeriod` when creating
358 355 # an openUA or openEU procedure. That field should not be present at all.
359 356 # Therefore, we pass a nondefault list of periods to `test_tender_data()`.
360 357 data = test_tender_data(params, ('tender',))
361 358 data['procurementMethodType'] = 'aboveThresholdUA'
362   - data['procurementMethodDetails'] = 'quick, ' \
363   - 'accelerator={}'.format(accelerator)
364 359 data['procuringEntity']['kind'] = 'general'
365 360 return data
366 361
367 362
368 363 def test_tender_data_openeu(params):
369   - accelerator = params['intervals']['accelerator']
370   - # Since `accelerator` field is not really a list containing timings
371   - # for a period called `acceleratorPeriod`, let's remove it :)
372   - del params['intervals']['accelerator']
373 364 # We should not provide any values for `enquiryPeriod` when creating
374 365 # an openUA or openEU procedure. That field should not be present at all.
375 366 # Therefore, we pass a nondefault list of periods to `test_tender_data()`.
376 367 data = test_tender_data(params, ('tender',))
377 368 data['procurementMethodType'] = 'aboveThresholdEU'
378   - data['procurementMethodDetails'] = 'quick, ' \
379   - 'accelerator={}'.format(accelerator)
380 369 data['title_en'] = "[TESTING]"
381 370 for item_number, item in enumerate(data['items']):
382 371 item['description_en'] = "Test item #{}".format(item_number)
... ...
... ... @@ -272,16 +272,11 @@ def prepare_test_tender_data(procedure_intervals, tender_parameters):
272 272 tender_parameters['intervals'] = intervals
273 273
274 274 # Set acceleration value for certain modes
275   - if mode in ['openua', 'openeu']:
276   - assert isinstance(intervals['accelerator'], int), \
277   - "Accelerator should be an 'int', " \
278   - "not '{}'".format(type(intervals['accelerator']).__name__)
279   - assert intervals['accelerator'] >= 0, \
280   - "Accelerator should not be less than 0"
281   - else:
282   - assert 'accelerator' not in intervals.keys(), \
283   - "Accelerator is not available for mode '{0}'".format(mode)
284   -
  275 + assert isinstance(intervals['accelerator'], int), \
  276 + "Accelerator should be an 'int', " \
  277 + "not '{}'".format(type(intervals['accelerator']).__name__)
  278 + assert intervals['accelerator'] >= 0, \
  279 + "Accelerator should not be less than 0"
285 280 if mode == 'negotiation':
286 281 return munchify({'data': test_tender_data_limited(tender_parameters)})
287 282 elif mode == 'negotiation.quick':
... ...
Please register or login to post a comment