Commit 8b7f67f8081c835326b6171a2f7f676e57dea339

Authored by alexdiatlov
Committed by GitHub
2 parents ac292abb 0dff02e7

Merge pull request #237 from ProzorroUKR/reasonType

reasonType cancellation
@@ -220,7 +220,7 @@ ${ERROR_PLAN_MESSAGE}= Calling method 'get_plan' failed: ResourceGone: {"status @@ -220,7 +220,7 @@ ${ERROR_PLAN_MESSAGE}= Calling method 'get_plan' failed: ResourceGone: {"status
220 ${period_intervals}= compute_intrs ${BROKERS} ${used_brokers} 220 ${period_intervals}= compute_intrs ${BROKERS} ${used_brokers}
221 ${accelerator}= Get Variable Value ${accelerator} 221 ${accelerator}= Get Variable Value ${accelerator}
222 ${accelerator}= Set Variable If '${accelerator}' != '${None}' ${accelerator} ${period_intervals.default.accelerator} 222 ${accelerator}= Set Variable If '${accelerator}' != '${None}' ${accelerator} ${period_intervals.default.accelerator}
223 - ${monitoring_data}= tets_monitoring_data ${USERS.users['${dasu_user}'].tender_data.data.id} ${accelerator} 223 + ${monitoring_data}= test_monitoring_data ${USERS.users['${dasu_user}'].tender_data.data.id} ${accelerator}
224 Log ${monitoring_data} 224 Log ${monitoring_data}
225 ${MNITORING_UAID}= Run As ${dasu_user} Створити об'єкт моніторингу ${monitoring_data} 225 ${MNITORING_UAID}= Run As ${dasu_user} Створити об'єкт моніторингу ${monitoring_data}
226 ${MONITORING}= Create Dictionary 226 ${MONITORING}= Create Dictionary
@@ -721,12 +721,13 @@ Library openprocurement_client.utils @@ -721,12 +721,13 @@ Library openprocurement_client.utils
721 721
722 722
723 Скасувати лот 723 Скасувати лот
724 - [Arguments] ${username} ${tender_uaid} ${lot_id} ${cancellation_reason} ${document} ${new_description} 724 + [Arguments] ${username} ${tender_uaid} ${lot_id} ${cancellation_reason} ${cancellation_reasonType} ${document} ${new_description}
725 ${tender}= openprocurement_client.Пошук тендера по ідентифікатору ${username} ${tender_uaid} 725 ${tender}= openprocurement_client.Пошук тендера по ідентифікатору ${username} ${tender_uaid}
726 ${lot_index}= get_object_index_by_id ${tender.data.lots} ${lot_id} 726 ${lot_index}= get_object_index_by_id ${tender.data.lots} ${lot_id}
727 ${lot_id}= Get Variable Value ${tender.data.lots[${lot_index}].id} 727 ${lot_id}= Get Variable Value ${tender.data.lots[${lot_index}].id}
728 ${data}= Create dictionary 728 ${data}= Create dictionary
729 ... reason=${cancellation_reason} 729 ... reason=${cancellation_reason}
  730 + ... reasonType=${cancellation_reasonType}
730 ... cancellationOf=lot 731 ... cancellationOf=lot
731 ... relatedLot=${lot_id} 732 ... relatedLot=${lot_id}
732 ${cancellation_data}= Create dictionary data=${data} 733 ${cancellation_data}= Create dictionary data=${data}
@@ -1609,9 +1610,11 @@ Library openprocurement_client.utils @@ -1609,9 +1610,11 @@ Library openprocurement_client.utils
1609 ... and call create_cancellation 1610 ... and call create_cancellation
1610 ... After that add document to cancellation and change description of document 1611 ... After that add document to cancellation and change description of document
1611 ... [Return] Nothing 1612 ... [Return] Nothing
1612 - [Arguments] ${username} ${tender_uaid} ${cancellation_reason} ${document} ${new_description} 1613 + [Arguments] ${username} ${tender_uaid} ${cancellation_reason} ${cancellation_reasonType} ${document} ${new_description}
1613 ${tender}= openprocurement_client.Пошук тендера по ідентифікатору ${username} ${tender_uaid} 1614 ${tender}= openprocurement_client.Пошук тендера по ідентифікатору ${username} ${tender_uaid}
1614 - ${data}= Create dictionary reason=${cancellation_reason} 1615 + ${data}= Create dictionary
  1616 + ... reason=${cancellation_reason}
  1617 + ... reasonType=${cancellation_reasonType}
1615 ${cancellation_data}= Create dictionary data=${data} 1618 ${cancellation_data}= Create dictionary data=${data}
1616 ${cancellation_data}= munch_dict arg=${cancellation_data} 1619 ${cancellation_data}= munch_dict arg=${cancellation_data}
1617 ${cancel_reply}= Call Method ${USERS.users['${username}'].client} create_cancellation 1620 ${cancel_reply}= Call Method ${USERS.users['${username}'].client} create_cancellation
@@ -164,24 +164,26 @@ ${PLAN_TENDER} ${True} @@ -164,24 +164,26 @@ ${PLAN_TENDER} ${True}
164 164
165 *** Keywords *** 165 *** Keywords ***
166 Можливість скасувати тендер 166 Можливість скасувати тендер
167 - ${cancellation_data}= Підготувати дані про скасування 167 + ${cancellation_data}= Підготувати дані про скасування ${USERS.users['${tender_owner}'].initial_data.data.procurementMethodType}
168 Run As ${tender_owner} 168 Run As ${tender_owner}
169 ... Скасувати закупівлю 169 ... Скасувати закупівлю
170 ... ${TENDER['TENDER_UAID']} 170 ... ${TENDER['TENDER_UAID']}
171 ... ${cancellation_data['cancellation_reason']} 171 ... ${cancellation_data['cancellation_reason']}
  172 + ... ${cancellation_data['cancellation_reasonType']}
172 ... ${cancellation_data['document']['doc_path']} 173 ... ${cancellation_data['document']['doc_path']}
173 ... ${cancellation_data['description']} 174 ... ${cancellation_data['description']}
174 Set To Dictionary ${USERS.users['${tender_owner}']} tender_cancellation_data=${cancellation_data} 175 Set To Dictionary ${USERS.users['${tender_owner}']} tender_cancellation_data=${cancellation_data}
175 176
176 177
177 Можливість скасувати ${index} лот 178 Можливість скасувати ${index} лот
178 - ${cancellation_data}= Підготувати дані про скасування 179 + ${cancellation_data}= Підготувати дані про скасування ${USERS.users['${tender_owner}'].initial_data.data.procurementMethodType}
179 ${lot_id}= get_id_from_object ${USERS.users['${tender_owner}'].initial_data.data.lots[${index}]} 180 ${lot_id}= get_id_from_object ${USERS.users['${tender_owner}'].initial_data.data.lots[${index}]}
180 Run As ${tender_owner} 181 Run As ${tender_owner}
181 ... Скасувати лот 182 ... Скасувати лот
182 ... ${TENDER['TENDER_UAID']} 183 ... ${TENDER['TENDER_UAID']}
183 ... ${lot_id} 184 ... ${lot_id}
184 ... ${cancellation_data['cancellation_reason']} 185 ... ${cancellation_data['cancellation_reason']}
  186 + ... ${cancellation_data['cancellation_reasonType']}
185 ... ${cancellation_data['document']['doc_path']} 187 ... ${cancellation_data['document']['doc_path']}
186 ... ${cancellation_data['description']} 188 ... ${cancellation_data['description']}
187 Set To Dictionary ${USERS.users['${tender_owner}']} lot_cancellation_data=${cancellation_data} 189 Set To Dictionary ${USERS.users['${tender_owner}']} lot_cancellation_data=${cancellation_data}
@@ -12,19 +12,19 @@ from munch import munchify @@ -12,19 +12,19 @@ from munch import munchify
12 from op_faker import OP_Provider 12 from op_faker import OP_Provider
13 from .local_time import get_now, TZ 13 from .local_time import get_now, TZ
14 14
15 -  
16 fake_en = Factory.create(locale='en_US') 15 fake_en = Factory.create(locale='en_US')
17 fake_ru = Factory.create(locale='ru_RU') 16 fake_ru = Factory.create(locale='ru_RU')
18 fake_uk = Factory.create(locale='uk_UA') 17 fake_uk = Factory.create(locale='uk_UA')
19 fake_uk.add_provider(OP_Provider) 18 fake_uk.add_provider(OP_Provider)
20 fake = fake_uk 19 fake = fake_uk
21 used_identifier_id = [] 20 used_identifier_id = []
22 -mode_open = ["belowThreshold", "aboveThresholdUA", "aboveThresholdEU",  
23 - "aboveThresholdUA.defense", "competitiveDialogueUA", "competitiveDialogueEU", "esco", "closeFrameworkAgreementUA"]  
24 -mode_limited = ["reporting", "negotiation.quick", "negotiation"] 21 +mode_open = ["belowThreshold", "aboveThresholdUA", "aboveThresholdEU",
  22 + "aboveThresholdUA.defense", "competitiveDialogueUA", "competitiveDialogueEU", "esco",
  23 + "closeFrameworkAgreementUA"]
  24 +mode_limited = ["reporting", "negotiation.quick", "negotiation"]
25 violationType = ["corruptionDescription", "corruptionProcurementMethodType", "corruptionChanges", 25 violationType = ["corruptionDescription", "corruptionProcurementMethodType", "corruptionChanges",
26 - "corruptionPublicDisclosure", "corruptionBiddingDocuments", "documentsForm",  
27 - "corruptionAwarded", "corruptionCancelled", "corruptionContracting"] 26 + "corruptionPublicDisclosure", "corruptionBiddingDocuments", "documentsForm",
  27 + "corruptionAwarded", "corruptionCancelled", "corruptionContracting"]
28 28
29 # This workaround fixes an error caused by missing "catch_phrase" class method 29 # This workaround fixes an error caused by missing "catch_phrase" class method
30 # for the "ru_RU" locale in Faker >= 0.7.4 30 # for the "ru_RU" locale in Faker >= 0.7.4
@@ -106,10 +106,10 @@ def create_fake_period(days=0, hours=0, minutes=0): @@ -106,10 +106,10 @@ def create_fake_period(days=0, hours=0, minutes=0):
106 106
107 107
108 def subtraction(value1, value2): 108 def subtraction(value1, value2):
109 - if "." in str (value1) or "." in str (value2):  
110 - return (float (value1) - float (value2)) 109 + if "." in str(value1) or "." in str(value2):
  110 + return (float(value1) - float(value2))
111 else: 111 else:
112 - return (int (value1) - int (value2)) 112 + return (int(value1) - int(value2))
113 113
114 114
115 def create_fake_value_amount(): 115 def create_fake_value_amount():
@@ -132,7 +132,7 @@ def translate_country_en(country): @@ -132,7 +132,7 @@ def translate_country_en(country):
132 132
133 133
134 def convert_amount(amount): 134 def convert_amount(amount):
135 - return (("{:,}".format(float (amount))).replace(',',' ').replace('.',',')) 135 + return ("{:,}".format(float(amount))).replace(',', ' ').replace('.', ',')
136 136
137 137
138 def translate_country_ru(country): 138 def translate_country_ru(country):
@@ -201,7 +201,7 @@ def test_tender_data(params, @@ -201,7 +201,7 @@ def test_tender_data(params,
201 accelerator = accelerator \ 201 accelerator = accelerator \
202 if accelerator else params['intervals']['accelerator'] 202 if accelerator else params['intervals']['accelerator']
203 data['procurementMethodDetails'] = 'quick, ' \ 203 data['procurementMethodDetails'] = 'quick, ' \
204 - 'accelerator={}'.format(accelerator) 204 + 'accelerator={}'.format(accelerator)
205 data["procuringEntity"]["kind"] = "other" 205 data["procuringEntity"]["kind"] = "other"
206 if data.get("mode") == "test": 206 if data.get("mode") == "test":
207 data["title"] = u"[ТЕСТУВАННЯ] {}".format(data["title"]) 207 data["title"] = u"[ТЕСТУВАННЯ] {}".format(data["title"])
@@ -318,7 +318,7 @@ def test_tender_data_planning(params): @@ -318,7 +318,7 @@ def test_tender_data_planning(params):
318 "mode": "test", 318 "mode": "test",
319 "items": [], 319 "items": [],
320 "buyers": [] 320 "buyers": []
321 - } 321 + }
322 data["procuringEntity"]["name"] = data["procuringEntity"]["identifier"]["legalName"] 322 data["procuringEntity"]["name"] = data["procuringEntity"]["identifier"]["legalName"]
323 buyers = test_buyers_data() 323 buyers = test_buyers_data()
324 buyers["name"] = buyers["identifier"]["legalName"] 324 buyers["name"] = buyers["identifier"]["legalName"]
@@ -345,7 +345,8 @@ def test_tender_data_planning(params): @@ -345,7 +345,8 @@ def test_tender_data_planning(params):
345 item_data = test_item_data(id_cpv) 345 item_data = test_item_data(id_cpv)
346 del item_data['deliveryAddress'] 346 del item_data['deliveryAddress']
347 del item_data['deliveryLocation'] 347 del item_data['deliveryLocation']
348 - item_data['deliveryDate']['endDate'] = (get_now() + timedelta(days=10)).replace(hour=0, minute=0, second=0, microsecond=0).isoformat() 348 + item_data['deliveryDate']['endDate'] = (get_now() + timedelta(days=10)).replace(hour=0, minute=0, second=0,
  349 + microsecond=0).isoformat()
349 del item_data['deliveryDate']['startDate'] 350 del item_data['deliveryDate']['startDate']
350 data['items'].append(item_data) 351 data['items'].append(item_data)
351 if params['mode'] in mode_open: 352 if params['mode'] in mode_open:
@@ -545,12 +546,12 @@ def test_bid_value(max_value_amount, vat_included): @@ -545,12 +546,12 @@ def test_bid_value(max_value_amount, vat_included):
545 def test_bid_value_esco(tender_data): 546 def test_bid_value_esco(tender_data):
546 annual_cost = [] 547 annual_cost = []
547 for i in range(0, 21): 548 for i in range(0, 21):
548 - cost=round(random.uniform(1, 100), 2) 549 + cost = round(random.uniform(1, 100), 2)
549 annual_cost.append(cost) 550 annual_cost.append(cost)
550 if tender_data['fundingKind'] == "budget": 551 if tender_data['fundingKind'] == "budget":
551 - yearly_percentage=round(random.uniform(0.01, float(tender_data['yearlyPaymentsPercentageRange'])), 5) 552 + yearly_percentage = round(random.uniform(0.01, float(tender_data['yearlyPaymentsPercentageRange'])), 5)
552 else: 553 else:
553 - yearly_percentage= 0.8 554 + yearly_percentage = 0.8
554 # when tender fundingKind is budget, yearlyPaymentsPercentageRange should be less or equal 0.8, and more or equal 0 555 # when tender fundingKind is budget, yearlyPaymentsPercentageRange should be less or equal 0.8, and more or equal 0
555 # when tender fundingKind is other, yearlyPaymentsPercentageRange should be equal 0.8 556 # when tender fundingKind is other, yearlyPaymentsPercentageRange should be equal 0.8
556 return munchify({ 557 return munchify({
@@ -577,7 +578,9 @@ def test_bid_data_selection(data, index): @@ -577,7 +578,9 @@ def test_bid_data_selection(data, index):
577 }) 578 })
578 bid.data['status'] = 'draft' 579 bid.data['status'] = 'draft'
579 bid.data['parameters'] = data['agreements'][0]['contracts'][index]['parameters'] 580 bid.data['parameters'] = data['agreements'][0]['contracts'][index]['parameters']
580 - bid.data['lotValues'] = [test_bid_value(data['agreements'][0]['contracts'][index]['value']['amount'], data['agreements'][0]['contracts'][index]['value']['valueAddedTaxIncluded'])] 581 + bid.data['lotValues'] = [test_bid_value(data['agreements'][0]['contracts'][index]['value']['amount'],
  582 + data['agreements'][0]['contracts'][index]['value'][
  583 + 'valueAddedTaxIncluded'])]
581 return bid 584 return bid
582 585
583 586
@@ -605,8 +608,10 @@ def test_item_data(cpv=None): @@ -605,8 +608,10 @@ def test_item_data(cpv=None):
605 startDate = fake.random_int(min=1, max=30) 608 startDate = fake.random_int(min=1, max=30)
606 endDate = startDate + fake.random_int(min=1, max=7) 609 endDate = startDate + fake.random_int(min=1, max=7)
607 data["deliveryDate"] = { 610 data["deliveryDate"] = {
608 - "startDate": (get_now() + timedelta(days=startDate)).astimezone(TZ).replace(hour=0, minute=0, second=0, microsecond=0).isoformat(),  
609 - "endDate": (get_now() + timedelta(days=endDate)).astimezone(TZ).replace(hour=0, minute=0, second=0, microsecond=0).isoformat() 611 + "startDate": (get_now() + timedelta(days=startDate)).astimezone(TZ).replace(hour=0, minute=0, second=0,
  612 + microsecond=0).isoformat(),
  613 + "endDate": (get_now() + timedelta(days=endDate)).astimezone(TZ).replace(hour=0, minute=0, second=0,
  614 + microsecond=0).isoformat()
610 } 615 }
611 data["deliveryAddress"]["countryName_en"] = translate_country_en(data["deliveryAddress"]["countryName"]) 616 data["deliveryAddress"]["countryName_en"] = translate_country_en(data["deliveryAddress"]["countryName"])
612 data["deliveryAddress"]["countryName_ru"] = translate_country_ru(data["deliveryAddress"]["countryName"]) 617 data["deliveryAddress"]["countryName_ru"] = translate_country_ru(data["deliveryAddress"]["countryName"])
@@ -698,7 +703,8 @@ def test_tender_data_openeu(params, submissionMethodDetails, plan_data): @@ -698,7 +703,8 @@ def test_tender_data_openeu(params, submissionMethodDetails, plan_data):
698 data['procuringEntity']['name_en'] = fake_en.name() 703 data['procuringEntity']['name_en'] = fake_en.name()
699 data['procuringEntity']['contactPoint']['name_en'] = fake_en.name() 704 data['procuringEntity']['contactPoint']['name_en'] = fake_en.name()
700 data['procuringEntity']['contactPoint']['availableLanguage'] = "en" 705 data['procuringEntity']['contactPoint']['availableLanguage'] = "en"
701 - data['procuringEntity']['identifier']['legalName_en'] = u"Institution \"Vinnytsia City Council primary and secondary general school № 10\"" 706 + data['procuringEntity']['identifier'][
  707 + 'legalName_en'] = u"Institution \"Vinnytsia City Council primary and secondary general school № 10\""
702 data['procuringEntity']['kind'] = 'general' 708 data['procuringEntity']['kind'] = 'general'
703 return data 709 return data
704 710
@@ -748,34 +754,34 @@ def test_tender_data_selection(procedure_intervals, params, submissionMethodDeta @@ -748,34 +754,34 @@ def test_tender_data_selection(procedure_intervals, params, submissionMethodDeta
748 data['agreements'] = [{'id': tender_data['data']['agreements'][0]['id']}] 754 data['agreements'] = [{'id': tender_data['data']['agreements'][0]['id']}]
749 del data['value'] 755 del data['value']
750 del data['minimalStep'] 756 del data['minimalStep']
751 - return munchify({'data':data}) 757 + return munchify({'data': data})
752 758
753 759
754 def test_change_data(): 760 def test_change_data():
755 return munchify( 761 return munchify(
756 - {  
757 - "data":  
758 { 762 {
759 - "rationale": fake.description(),  
760 - "rationale_en": fake_en.sentence(nb_words=10, variable_nb_words=True),  
761 - "rationale_ru": fake_ru.sentence(nb_words=10, variable_nb_words=True),  
762 - "rationaleTypes": fake.rationaleTypes(amount=3),  
763 - "status": "pending"  
764 - }  
765 - }) 763 + "data":
  764 + {
  765 + "rationale": fake.description(),
  766 + "rationale_en": fake_en.sentence(nb_words=10, variable_nb_words=True),
  767 + "rationale_ru": fake_ru.sentence(nb_words=10, variable_nb_words=True),
  768 + "rationaleTypes": fake.rationaleTypes(amount=3),
  769 + "status": "pending"
  770 + }
  771 + })
766 772
767 773
768 def test_agreement_change_data(rationaleType): 774 def test_agreement_change_data(rationaleType):
769 return munchify( 775 return munchify(
770 - {  
771 - "data":  
772 { 776 {
773 - "rationale": fake.description(),  
774 - "rationale_en": fake_en.sentence(nb_words=10, variable_nb_words=True),  
775 - "rationale_ru": fake_ru.sentence(nb_words=10, variable_nb_words=True),  
776 - "rationaleType": rationaleType,  
777 - }  
778 - }) 777 + "data":
  778 + {
  779 + "rationale": fake.description(),
  780 + "rationale_en": fake_en.sentence(nb_words=10, variable_nb_words=True),
  781 + "rationale_ru": fake_ru.sentence(nb_words=10, variable_nb_words=True),
  782 + "rationaleType": rationaleType,
  783 + }
  784 + })
779 785
780 786
781 def test_modification_data(item_id, field_name, field_value): 787 def test_modification_data(item_id, field_name, field_value):
@@ -787,24 +793,21 @@ def test_modification_data(item_id, field_name, field_value): @@ -787,24 +793,21 @@ def test_modification_data(item_id, field_name, field_value):
787 } 793 }
788 ] 794 ]
789 } 795 }
790 - return munchify({'data':data}) 796 + return munchify({'data': data})
791 797
792 798
793 def get_hash(file_contents): 799 def get_hash(file_contents):
794 - return ("md5:"+hashlib.md5(file_contents).hexdigest()) 800 + return ("md5:" + hashlib.md5(file_contents).hexdigest())
795 801
796 802
797 -def tets_monitoring_data( tender_id, accelerator=None):  
798 - data = {  
799 - "reasons": [random.choice(["public", "fiscal", "indicator", "authorities", "media"])],  
800 - "tender_id": tender_id,  
801 - "procuringStages": [random.choice(["awarding", "contracting", "planning"])],  
802 - "parties": [test_party()],  
803 - "mode": "test"  
804 - }  
805 - data['monitoringDetails'] = 'quick, ' \  
806 - 'accelerator={}'.format(accelerator)  
807 - return munchify({'data':data}) 803 +def test_monitoring_data(tender_id, accelerator=None):
  804 + data = {"reasons": [random.choice(["public", "fiscal", "indicator", "authorities", "media"])],
  805 + "tender_id": tender_id,
  806 + "procuringStages": [random.choice(["awarding", "contracting", "planning"])],
  807 + "parties": [test_party()],
  808 + "mode": "test",
  809 + 'monitoringDetails': 'quick, ' 'accelerator={}'.format(accelerator)}
  810 + return munchify({'data': data})
808 811
809 812
810 def test_party(): 813 def test_party():
@@ -816,26 +819,26 @@ def test_party(): @@ -816,26 +819,26 @@ def test_party():
816 819
817 def test_dialogue(): 820 def test_dialogue():
818 return munchify( 821 return munchify(
819 - {  
820 - "data":  
821 { 822 {
822 - "title": fake_en.sentence(nb_words=10, variable_nb_words=True),  
823 - "description": fake_en.sentence(nb_words=10, variable_nb_words=True)  
824 - }  
825 - }) 823 + "data":
  824 + {
  825 + "title": fake_en.sentence(nb_words=10, variable_nb_words=True),
  826 + "description": fake_en.sentence(nb_words=10, variable_nb_words=True)
  827 + }
  828 + })
826 829
827 830
828 def test_conclusion(violationOccurred, relatedParty_id): 831 def test_conclusion(violationOccurred, relatedParty_id):
829 return munchify( 832 return munchify(
830 - {  
831 - "data": {  
832 - "conclusion": {  
833 - "violationOccurred": violationOccurred,  
834 - "violationType": random.choice(violationType),  
835 - "relatedParty": relatedParty_id, 833 + {
  834 + "data": {
  835 + "conclusion": {
  836 + "violationOccurred": violationOccurred,
  837 + "violationType": random.choice(violationType),
  838 + "relatedParty": relatedParty_id,
  839 + }
836 } 840 }
837 - }  
838 - }) 841 + })
839 842
840 843
841 def test_status_data(status, relatedParty_id=None): 844 def test_status_data(status, relatedParty_id=None):
@@ -890,7 +893,7 @@ def test_tender_data_esco(params, submissionMethodDetails, plan_data): @@ -890,7 +893,7 @@ def test_tender_data_esco(params, submissionMethodDetails, plan_data):
890 if index == 0: 893 if index == 0:
891 data['lots'][index]['minimalStepPercentage'] = data['minimalStepPercentage'] 894 data['lots'][index]['minimalStepPercentage'] = data['minimalStepPercentage']
892 else: 895 else:
893 - data['lots'][index]['minimalStepPercentage'] = round((float(data['minimalStepPercentage'])-0.0002), 5) 896 + data['lots'][index]['minimalStepPercentage'] = round((float(data['minimalStepPercentage']) - 0.0002), 5)
894 if data['fundingKind'] == "budget": 897 if data['fundingKind'] == "budget":
895 data['lots'][index]['yearlyPaymentsPercentageRange'] = float(round(random.uniform(0.01, 0.8), 5)) 898 data['lots'][index]['yearlyPaymentsPercentageRange'] = float(round(random.uniform(0.01, 0.8), 5))
896 else: 899 else:
@@ -932,25 +935,25 @@ def percentage_generation(number_of_milestones): @@ -932,25 +935,25 @@ def percentage_generation(number_of_milestones):
932 935
933 def invalid_INN_data(): 936 def invalid_INN_data():
934 return munchify({ 937 return munchify({
935 - "scheme": "INN",  
936 - "description": "Insulin (human)",  
937 - "id": "insulin (human)" 938 + "scheme": "INN",
  939 + "description": "Insulin (human)",
  940 + "id": "insulin (human)"
938 }) 941 })
939 942
940 943
941 def invalid_cost_data(): 944 def invalid_cost_data():
942 return munchify({ 945 return munchify({
943 - "scheme": "UA-ROAD",  
944 - "id": "H-08",  
945 - "description": "Бориспіль - Дніпро - Запоріжжя (через м. Кременчук) - Маріуполь" 946 + "scheme": "UA-ROAD",
  947 + "id": "H-08",
  948 + "description": "Бориспіль - Дніпро - Запоріжжя (через м. Кременчук) - Маріуполь"
946 }) 949 })
947 950
948 951
949 def invalid_gmdn_data(): 952 def invalid_gmdn_data():
950 return munchify({ 953 return munchify({
951 - "scheme": "GMDN",  
952 - "id": "10082",  
953 - "description": "Змішувач амальгами для стоматології" 954 + "scheme": "GMDN",
  955 + "id": "10082",
  956 + "description": "Змішувач амальгами для стоматології"
954 }) 957 })
955 958
956 959
@@ -973,7 +976,7 @@ def invalid_buyers_data(): @@ -973,7 +976,7 @@ def invalid_buyers_data():
973 "legalName": "Київський Тестовий Ліцей", 976 "legalName": "Київський Тестовий Ліцей",
974 }, 977 },
975 "name": "Київський Тестовий Ліцей" 978 "name": "Київський Тестовий Ліцей"
976 - } 979 + }
977 return munchify(buyers) 980 return munchify(buyers)
978 981
979 982
@@ -1011,3 +1014,15 @@ def breakdown_value_generation(number_of_breakdown, plan_value): @@ -1011,3 +1014,15 @@ def breakdown_value_generation(number_of_breakdown, plan_value):
1011 value_data = [round(random.uniform(1, plan_value / number_of_breakdown), 2) for _ in range(number_of_breakdown - 1)] 1014 value_data = [round(random.uniform(1, plan_value / number_of_breakdown), 2) for _ in range(number_of_breakdown - 1)]
1012 value_data.append(round(plan_value - sum(value_data), 2)) 1015 value_data.append(round(plan_value - sum(value_data), 2))
1013 return value_data 1016 return value_data
  1017 +
  1018 +
  1019 +def test_cancellation_data(procurement_method_type):
  1020 + if procurement_method_type == "aboveThresholdUA.defense":
  1021 + result = random.choice(["noDemand", "unFixable", "expensesCut"])
  1022 + elif procurement_method_type in ["negotiation", "negotiation.quick"]:
  1023 + result = random.choice(["noObjectiveness", "unFixable", "noDemand", "expensesCut", "dateViolation"])
  1024 + elif procurement_method_type == "belowThreshold":
  1025 + result = random.choice(["noDemand", "unFixable", "expensesCut"])
  1026 + else:
  1027 + result = random.choice(["noDemand", "unFixable", "forceMajeure", "expensesCut"])
  1028 + return munchify({"reasonType": result})
@@ -342,6 +342,8 @@ Get Broker Property By Username @@ -342,6 +342,8 @@ Get Broker Property By Username
342 342
343 343
344 Підготувати дані про скасування 344 Підготувати дані про скасування
  345 + [Arguments] ${procurementMethodType}
  346 + ${cancellation_data}= test_cancellation_data ${procurementMethodType}
345 ${cancellation_reason}= create_fake_sentence 347 ${cancellation_reason}= create_fake_sentence
346 ${cancellation_reason}= field_with_id c ${cancellation_reason} 348 ${cancellation_reason}= field_with_id c ${cancellation_reason}
347 ${cancellation_id}= get_id_from_string ${cancellation_reason} 349 ${cancellation_id}= get_id_from_string ${cancellation_reason}
@@ -355,6 +357,7 @@ Get Broker Property By Username @@ -355,6 +357,7 @@ Get Broker Property By Username
355 ${new_description}= create_fake_sentence 357 ${new_description}= create_fake_sentence
356 ${cancellation_data}= Create Dictionary 358 ${cancellation_data}= Create Dictionary
357 ... cancellation_reason=${cancellation_reason} 359 ... cancellation_reason=${cancellation_reason}
  360 + ... cancellation_reasonType=${cancellation_data.reasonType}
358 ... cancellation_id=${cancellation_id} 361 ... cancellation_id=${cancellation_id}
359 ... document=${document} 362 ... document=${document}
360 ... description=${new_description} 363 ... description=${new_description}
@@ -60,7 +60,7 @@ from .initial_data import ( @@ -60,7 +60,7 @@ from .initial_data import (
60 test_tender_data_framework_agreement, 60 test_tender_data_framework_agreement,
61 test_tender_data_selection, 61 test_tender_data_selection,
62 test_bid_competitive_data, 62 test_bid_competitive_data,
63 - tets_monitoring_data, 63 + test_monitoring_data,
64 test_party, 64 test_party,
65 test_dialogue, 65 test_dialogue,
66 test_conclusion, 66 test_conclusion,
@@ -80,7 +80,8 @@ from .initial_data import ( @@ -80,7 +80,8 @@ from .initial_data import (
80 invalid_gmdn_data, 80 invalid_gmdn_data,
81 invalid_buyers_data, 81 invalid_buyers_data,
82 test_plan_cancel_data, 82 test_plan_cancel_data,
83 - test_confirm_plan_cancel_data 83 + test_confirm_plan_cancel_data,
  84 + test_cancellation_data
84 ) 85 )
85 from barbecue import chef 86 from barbecue import chef
86 from restkit import request 87 from restkit import request
Please register or login to post a comment