Commit 54ab1293bc906bb78256ffdd6cbb623b1a2bceed

Authored by OrysiaDrabych
1 parent 0149ee2a

Generate test data for openua_defense procedure

... ... @@ -466,6 +466,16 @@ def test_tender_data_openua(params, submissionMethodDetails):
466 466 return data
467 467
468 468
  469 +def test_tender_data_openua_defense(params, submissionMethodDetails):
  470 + """We should not provide any values for `enquiryPeriod` when creating
  471 + an openUA, openEU or openUA_defense procedure. That field should not be present at all.
  472 + Therefore, we pass a nondefault list of periods to `test_tender_data()`."""
  473 + data = test_tender_data(params, ('tender',), submissionMethodDetails)
  474 + data['procurementMethodType'] = 'aboveThresholdUA.defense'
  475 + data['procuringEntity']['kind'] = 'defense'
  476 + return data
  477 +
  478 +
469 479 def test_tender_data_openeu(params, submissionMethodDetails):
470 480 # We should not provide any values for `enquiryPeriod` when creating
471 481 # an openUA or openEU procedure. That field should not be present at all.
... ...
... ... @@ -47,6 +47,7 @@ from .initial_data import (
47 47 test_tender_data_openeu,
48 48 test_tender_data_openua,
49 49 test_tender_data_planning,
  50 + test_tender_data_openua_defense,
50 51 create_fake_title,
51 52 create_fake_value_amount,
52 53 test_change_document_data,
... ... @@ -315,6 +316,9 @@ def prepare_test_tender_data(procedure_intervals,
315 316 elif mode == 'openua':
316 317 return munchify({'data': test_tender_data_openua(
317 318 tender_parameters, submissionMethodDetails)})
  319 + elif mode == 'openua_defense':
  320 + return munchify({'data': test_tender_data_openua_defense(
  321 + tender_parameters, submissionMethodDetails)})
318 322 elif mode == 'open_competitive_dialogue':
319 323 return munchify({'data': test_tender_data_competitive_dialogue(
320 324 tender_parameters, submissionMethodDetails)})
... ... @@ -511,7 +515,13 @@ def get_object_by_id(data, given_object_id, slice_element, object_id):
511 515
512 516 def generate_test_bid_data(tender_data):
513 517 bid = test_bid_data()
514   - if tender_data.get('procurementMethodType', '')[:-2] in ('aboveThreshold', 'competitiveDialogue'):
  518 + if tender_data.get('procurementMethodType', '') in (
  519 + 'aboveThresholdUA',
  520 + 'aboveThresholdUA.defense',
  521 + 'aboveThresholdEU',
  522 + 'competitiveDialogueUA'
  523 + 'competitiveDialogueEU'
  524 + ):
515 525 bid.data.selfEligible = True
516 526 bid.data.selfQualified = True
517 527 if 'lots' in tender_data:
... ...
Please register or login to post a comment