Showing
4 changed files
with
39 additions
and
5 deletions
... | ... | @@ -1237,7 +1237,7 @@ Library openprocurement_client.utils |
1237 | 1237 | Set To Dictionary ${USERS.users['${username}']} bid_access_token=${reply.access.token} |
1238 | 1238 | ${tender}= set_access_key ${tender} ${USERS.users['${username}'].bid_access_token} |
1239 | 1239 | ${procurementMethodType}= Get variable value ${USERS.users['${username}'].tender_data.data.procurementMethodType} |
1240 | - ${methods}= Create List competitiveDialogueUA competitiveDialogueEU competitiveDialogueEU.stage2 aboveThresholdEU closeFrameworkAgreementUA | |
1240 | + ${methods}= Create List competitiveDialogueUA competitiveDialogueEU competitiveDialogueEU.stage2 aboveThresholdEU closeFrameworkAgreementUA esco | |
1241 | 1241 | ${status}= Set Variable If '${procurementMethodType}' in ${methods} pending active |
1242 | 1242 | Set To Dictionary ${reply['data']} status=${status} |
1243 | 1243 | ${reply_active}= Call Method ${USERS.users['${username}'].client} patch_bid | ... | ... |
... | ... | @@ -443,6 +443,32 @@ def test_bid_value(max_value_amount): |
443 | 443 | }) |
444 | 444 | |
445 | 445 | |
446 | +def test_bid_value_esco(tender_data): | |
447 | + annual_cost = [] | |
448 | + for i in range(0, 21): | |
449 | + cost=round(random.uniform(1, 100), 2) | |
450 | + annual_cost.append(cost) | |
451 | + if tender_data['fundingKind'] == "budget": | |
452 | + yearly_percentage=round(random.uniform(0.01, float(tender_data['yearlyPaymentsPercentageRange'])), 5) | |
453 | + else: | |
454 | + yearly_percentage= 0.8 | |
455 | + # when tender fundingKind is budget, yearlyPaymentsPercentageRange should be less or equal 0.8, and more or equal 0 | |
456 | + # when tender fundingKind is other, yearlyPaymentsPercentageRange should be equal 0.8 | |
457 | + return munchify({ | |
458 | + "value": { | |
459 | + "currency": "UAH", | |
460 | + "valueAddedTaxIncluded": True, | |
461 | + "yearlyPaymentsPercentage": yearly_percentage, | |
462 | + "annualCostsReduction": annual_cost, | |
463 | + "contractDuration": { | |
464 | + "years": random.randint(7, 14), | |
465 | + "days": random.randint(1, 364) | |
466 | + } | |
467 | + } | |
468 | + }) | |
469 | + | |
470 | + | |
471 | + | |
446 | 472 | def test_supplier_data(): |
447 | 473 | return munchify({ |
448 | 474 | "data": { | ... | ... |
... | ... | @@ -30,6 +30,7 @@ from .initial_data import ( |
30 | 30 | field_with_id, |
31 | 31 | test_bid_data, |
32 | 32 | test_bid_value, |
33 | + test_bid_value_esco, | |
33 | 34 | test_change_data, |
34 | 35 | test_claim_answer_data, |
35 | 36 | test_claim_data, |
... | ... | @@ -605,7 +606,8 @@ def generate_test_bid_data(tender_data): |
605 | 606 | 'aboveThresholdEU', |
606 | 607 | 'competitiveDialogueUA', |
607 | 608 | 'competitiveDialogueEU', |
608 | - 'closeFrameworkAgreementUA' | |
609 | + 'closeFrameworkAgreementUA', | |
610 | + 'esco' | |
609 | 611 | ): |
610 | 612 | bid = test_bid_competitive_data() |
611 | 613 | bid.data.selfEligible = True |
... | ... | @@ -615,11 +617,18 @@ def generate_test_bid_data(tender_data): |
615 | 617 | if 'lots' in tender_data: |
616 | 618 | bid.data.lotValues = [] |
617 | 619 | for lot in tender_data['lots']: |
618 | - value = test_bid_value(lot['value']['amount']) | |
620 | + if tender_data.get('procurementMethodType', '') == 'esco': | |
621 | + value = test_bid_value_esco(tender_data) | |
622 | + else: | |
623 | + value = test_bid_value(lot['value']['amount']) | |
619 | 624 | value['relatedLot'] = lot.get('id', '') |
620 | 625 | bid.data.lotValues.append(value) |
621 | 626 | else: |
622 | - bid.data.update(test_bid_value(tender_data['value']['amount'])) | |
627 | + if tender_data.get('procurementMethodType', '') == 'esco': | |
628 | + value = test_bid_value(tender_data) | |
629 | + bid.data.update(value) | |
630 | + else: | |
631 | + bid.data.update(test_bid_value(tender_data['value']['amount'])) | |
623 | 632 | if 'features' in tender_data: |
624 | 633 | bid.data.parameters = [] |
625 | 634 | for feature in tender_data['features']: | ... | ... |
Please
register
or
login
to post a comment