Commit 39371f64e3ef9491d980f3aff8c76dad83c298c7

Authored by alexdiatlov
Committed by GitHub
2 parents c475ae89 b6753936

Merge pull request #146 from ProzorroUKR/dev_prozorro

Dev prozorro
... ... @@ -9,6 +9,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status":
9 9
10 10 *** Keywords ***
11 11 Можливість оголосити тендер
  12 + ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml
  13 + ${ARTIFACT}= load_data_from ${file_path}
  14 + Log ${ARTIFACT.tender_uaid}
12 15 ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS}
13 16 ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS}
14 17 ${NUMBER_OF_MILESTONES}= Convert To Integer ${NUMBER_OF_MILESTONES}
... ... @@ -25,11 +28,14 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status":
25 28 ... vat_included=${${VAT_INCLUDED}}
26 29 ... road_index=${${ROAD_INDEX}}
27 30 ... gmdn_index=${${GMDN_INDEX}}
  31 + ... plan_tender=${${PLAN_TENDER}}
28 32 ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE}
29 33 ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND}
30 34 Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE}
31 35 Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND}
32   - ${tender_data}= Підготувати дані для створення тендера ${tender_parameters}
  36 + ${plan_data}= Run as ${tender_owner} Пошук плану по ідентифікатору ${ARTIFACT.tender_uaid}
  37 + Log ${plan_data}
  38 + ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} ${plan_data}
33 39 ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data}
34 40 ${TENDER_UAID}= Run As ${tender_owner} Створити тендер ${adapted_data}
35 41 Set To Dictionary ${USERS.users['${tender_owner}']} initial_data=${adapted_data}
... ... @@ -62,6 +68,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status":
62 68
63 69
64 70 Можливість оголосити тендер з використанням валідації для MNN
  71 + ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml
  72 + ${ARTIFACT}= load_data_from ${file_path}
  73 + Log ${ARTIFACT.tender_uaid}
65 74 [Arguments] ${data_version}
66 75 ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS}
67 76 ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS}
... ... @@ -78,11 +87,14 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status":
78 87 ... moz_integration=${${MOZ_INTEGRATION}}
79 88 ... road_index=${${ROAD_INDEX}}
80 89 ... gmdn_index=${${GMDN_INDEX}}
  90 + ... plan_tender=${${PLAN_TENDER}}
81 91 ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE}
82 92 ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND}
83 93 Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE}
84 94 Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND}
85   - ${tender_data}= Підготувати дані для створення тендера ${tender_parameters}
  95 + ${plan_data}= Run as ${tender_owner} Пошук плану по ідентифікатору ${ARTIFACT.tender_uaid}
  96 + Log ${plan_data}
  97 + ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} ${plan_data}
86 98 ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data}
87 99 ${adapted_data_mnn}= edit_tender_data_for_mnn ${adapted_data} ${MODE} ${data_version}
88 100 Log ${adapted_data_mnn}
... ... @@ -93,6 +105,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status":
93 105
94 106 Можливість оголосити тендер з використанням валідації Індекс автомобільних доріг
95 107 [Arguments] ${data_version}
  108 + ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml
  109 + ${ARTIFACT}= load_data_from ${file_path}
  110 + Log ${ARTIFACT.tender_uaid}
96 111 ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS}
97 112 ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS}
98 113 ${NUMBER_OF_MILESTONES}= Convert To Integer ${NUMBER_OF_MILESTONES}
... ... @@ -108,11 +123,14 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status":
108 123 ... moz_integration=${${MOZ_INTEGRATION}}
109 124 ... road_index=${${ROAD_INDEX}}
110 125 ... gmdn_index=${${GMDN_INDEX}}
  126 + ... plan_tender=${${PLAN_TENDER}}
111 127 ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE}
112 128 ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND}
113 129 Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE}
114 130 Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND}
115   - ${tender_data}= Підготувати дані для створення тендера ${tender_parameters}
  131 + ${plan_data}= Run as ${tender_owner} Пошук плану по ідентифікатору ${ARTIFACT.tender_uaid}
  132 + Log ${plan_data}
  133 + ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} ${plan_data}
116 134 ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data}
117 135 ${adapted_data_cost}= edit_tender_data_for_cost ${adapted_data} ${MODE} ${data_version}
118 136 Log ${adapted_data_cost}
... ... @@ -123,6 +141,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status":
123 141
124 142 Можливість оголосити тендер з використанням валідації класифікатор медичних виробів
125 143 [Arguments] ${data_version}
  144 + ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml
  145 + ${ARTIFACT}= load_data_from ${file_path}
  146 + Log ${ARTIFACT.tender_uaid}
126 147 ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS}
127 148 ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS}
128 149 ${NUMBER_OF_MILESTONES}= Convert To Integer ${NUMBER_OF_MILESTONES}
... ... @@ -138,11 +159,14 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status":
138 159 ... moz_integration=${${MOZ_INTEGRATION}}
139 160 ... road_index=${${ROAD_INDEX}}
140 161 ... gmdn_index=${${GMDN_INDEX}}
  162 + ... plan_tender=${${PLAN_TENDER}}
141 163 ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE}
142 164 ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND}
143 165 Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE}
144 166 Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND}
145   - ${tender_data}= Підготувати дані для створення тендера ${tender_parameters}
  167 + ${plan_data}= Run as ${tender_owner} Пошук плану по ідентифікатору ${ARTIFACT.tender_uaid}
  168 + Log ${plan_data}
  169 + ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} ${plan_data}
146 170 ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data}
147 171 ${adapted_data_gmdn}= edit_tender_data_for_gmdn ${adapted_data} ${MODE} ${data_version}
148 172 Log ${adapted_data_gmdn}
... ... @@ -151,6 +175,42 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status":
151 175 Set To Dictionary ${TENDER} TENDER_UAID=${TENDER_UAID}
152 176
153 177
  178 +Можливість оголосити тендер з використанням валідації план-тендер
  179 + [Arguments] ${data_version}
  180 + ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml
  181 + ${ARTIFACT}= load_data_from ${file_path}
  182 + Log ${ARTIFACT.tender_uaid}
  183 + ${NUMBER_OF_LOTS}= Convert To Integer ${NUMBER_OF_LOTS}
  184 + ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS}
  185 + ${NUMBER_OF_MILESTONES}= Convert To Integer ${NUMBER_OF_MILESTONES}
  186 + ${tender_parameters}= Create Dictionary
  187 + ... mode=${MODE}
  188 + ... number_of_items=${NUMBER_OF_ITEMS}
  189 + ... number_of_lots=${NUMBER_OF_LOTS}
  190 + ... number_of_milestones=${NUMBER_OF_MILESTONES}
  191 + ... tender_meat=${${TENDER_MEAT}}
  192 + ... lot_meat=${${LOT_MEAT}}
  193 + ... item_meat=${${ITEM_MEAT}}
  194 + ... api_host_url=${API_HOST_URL}
  195 + ... moz_integration=${${MOZ_INTEGRATION}}
  196 + ... road_index=${${ROAD_INDEX}}
  197 + ... gmdn_index=${${GMDN_INDEX}}
  198 + ... plan_tender=${${PLAN_TENDER}}
  199 + ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE}
  200 + ${FUNDING_KIND}= Get Variable Value ${FUNDING_KIND}
  201 + Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE}
  202 + Run keyword if '${FUNDING_KIND}' != '${None}' Set to dictionary ${tender_parameters} fundingKind=${FUNDING_KIND}
  203 + ${plan_data}= Run as ${tender_owner} Пошук плану по ідентифікатору ${ARTIFACT.tender_uaid}
  204 + Log ${plan_data}
  205 + ${tender_data}= Підготувати дані для створення тендера ${tender_parameters} ${plan_data}
  206 + ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data}
  207 + ${adapted_data_plan_tender}= edit_tender_data_for_plan_tender ${adapted_data} ${MODE} ${data_version}
  208 + Log ${adapted_data_plan_tender}
  209 + ${TENDER_UAID}= Run As ${tender_owner} Створити тендер ${adapted_data_plan_tender}
  210 + Set To Dictionary ${USERS.users['${tender_owner}']} initial_data=${adapted_data_plan_tender}
  211 + Set To Dictionary ${TENDER} TENDER_UAID=${TENDER_UAID}
  212 +
  213 +
154 214 Можливість створити об'єкт моніторингу
155 215 ${period_intervals}= compute_intrs ${BROKERS} ${used_brokers}
156 216 ${accelerator}= Get Variable Value ${accelerator}
... ... @@ -182,6 +242,9 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status":
182 242 ... number_of_items=${NUMBER_OF_ITEMS}
183 243 ... tender_meat=${${TENDER_MEAT}}
184 244 ... item_meat=${${ITEM_MEAT}}
  245 + ... moz_integration=${${MOZ_INTEGRATION}}
  246 + ... road_index=${${ROAD_INDEX}}
  247 + ... gmdn_index=${${GMDN_INDEX}}
185 248 ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE}
186 249 Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE}
187 250 ${tender_data}= Підготувати дані для створення плану ${tender_parameters}
... ... @@ -191,6 +254,26 @@ ${ERROR_MESSAGE}= Calling method 'get_tender' failed: ResourceGone: {"status":
191 254 Set To Dictionary ${TENDER} TENDER_UAID=${TENDER_UAID}
192 255
193 256
  257 +Можливість створити план закупівлі з використанням валідації для buyers
  258 + [Arguments] ${data_version}
  259 + ${NUMBER_OF_ITEMS}= Convert To Integer ${NUMBER_OF_ITEMS}
  260 + ${tender_parameters}= Create Dictionary
  261 + ... mode=${MODE}
  262 + ... number_of_items=${NUMBER_OF_ITEMS}
  263 + ... tender_meat=${${TENDER_MEAT}}
  264 + ... item_meat=${${ITEM_MEAT}}
  265 + ... moz_integration=${${MOZ_INTEGRATION}}
  266 + ${DIALOGUE_TYPE}= Get Variable Value ${DIALOGUE_TYPE}
  267 + Run keyword if '${DIALOGUE_TYPE}' != '${None}' Set to dictionary ${tender_parameters} dialogue_type=${DIALOGUE_TYPE}
  268 + ${tender_data}= Підготувати дані для створення плану ${tender_parameters}
  269 + ${adapted_data}= Адаптувати дані для оголошення тендера ${tender_data}
  270 + ${adapted_data_buyers}= edit_plan_buyers ${adapted_data} ${data_version}
  271 + Log ${adapted_data_buyers}
  272 + ${TENDER_UAID}= Run As ${tender_owner} Створити план ${adapted_data_buyers}
  273 + Set To Dictionary ${USERS.users['${tender_owner}']} initial_data=${adapted_data_buyers}
  274 + Set To Dictionary ${TENDER} TENDER_UAID=${TENDER_UAID}
  275 +
  276 +
194 277 Можливість знайти тендер по ідентифікатору для усіх користувачів
195 278 :FOR ${username} IN ${tender_owner} ${provider} ${provider1} ${provider2} ${viewer}
196 279 \ Можливість знайти тендер по ідентифікатору для користувача ${username}
... ...
... ... @@ -24,8 +24,8 @@ Library openprocurement_client.utils
24 24 Log Many ${USERS.users['${username}'].id_map}
25 25 ${status}= Run Keyword And Return Status Dictionary Should Contain Key ${USERS.users['${username}'].id_map} ${tender_uaid}
26 26 Run Keyword And Return If ${status} Get From Dictionary ${USERS.users['${username}'].id_map} ${tender_uaid}
27   - Call Method ${USERS.users['${username}'].client} get_plans
28   - ${tender_id}= Wait Until Keyword Succeeds 5x 30 sec get_plan_id_by_uaid ${tender_uaid} ${USERS.users['${username}'].client}
  27 + Call Method ${USERS.users['${username}'].plan_client} get_plans
  28 + ${tender_id}= Wait Until Keyword Succeeds 5x 30 sec get_plan_id_by_uaid ${tender_uaid} ${USERS.users['${username}'].plan_client}
29 29 Set To Dictionary ${USERS.users['${username}'].id_map} ${tender_uaid} ${tender_id}
30 30 [return] ${tender_id}
31 31
... ... @@ -69,9 +69,14 @@ Library openprocurement_client.utils
69 69 Log ${auth_ds}
70 70
71 71 ${ds_config}= Create Dictionary host_url=${ds_host_url} auth_ds=${auth_ds}
72   - ${api_wrapper}= Run Keyword If '${RESOURCE}' == 'plans'
73   - ... prepare_plan_api_wrapper ${USERS.users['${username}'].api_key} PLANS ${API_HOST_URL} ${API_VERSION}
74   - ... ELSE prepare_api_wrapper ${USERS.users['${username}'].api_key} ${RESOURCE} ${API_HOST_URL} ${API_VERSION} ${ds_config}
  72 + ${plan_api_wrapper}= prepare_plan_api_wrapper ${USERS.users['${username}'].api_key} PLANS ${API_HOST_URL} ${API_VERSION}
  73 + ${tender_api_wrapper}= prepare_api_wrapper ${USERS.users['${username}'].api_key} TENDERS ${API_HOST_URL} ${API_VERSION} ${ds_config}
  74 + ${tender_create_wrapper}= prepare_tender_create_wrapper
  75 + ... ${USERS.users['${username}'].api_key}
  76 + ... PLANS
  77 + ... ${API_HOST_URL}
  78 + ... ${API_VERSION}
  79 + ... ${ds_config}
75 80 ${dasu_api_wraper}= prepare_dasu_api_wrapper
76 81 ... ${DASU_RESOURCE}
77 82 ... ${DASU_API_HOST_URL}
... ... @@ -80,7 +85,9 @@ Library openprocurement_client.utils
80 85 ... ${USERS.users['${username}'].auth_dasu[1]}
81 86 ... ${ds_config}
82 87 ${agreement_wrapper}= prepare_agreement_api_wrapper ${USERS.users['${username}'].api_key} AGREEMENTS ${API_HOST_URL} ${API_VERSION} ${ds_config}
83   - Set To Dictionary ${USERS.users['${username}']} client=${api_wrapper}
  88 + Set To Dictionary ${USERS.users['${username}']} client=${tender_api_wrapper}
  89 + Set To Dictionary ${USERS.users['${username}']} plan_client=${plan_api_wrapper}
  90 + Set To Dictionary ${USERS.users['${username}']} tender_create_client=${tender_create_wrapper}
84 91 Set To Dictionary ${USERS.users['${username}']} agreement_client=${agreement_wrapper}
85 92 Set To Dictionary ${USERS.users['${username}']} dasu_client=${dasu_api_wraper}
86 93 Set To Dictionary ${USERS.users['${username}']} access_token=${EMPTY}
... ... @@ -183,7 +190,14 @@ Library openprocurement_client.utils
183 190
184 191 Створити тендер
185 192 [Arguments] ${username} ${tender_data}
186   - ${tender}= Call Method ${USERS.users['${username}'].client} create_tender ${tender_data}
  193 + ${file_path}= Get Variable Value ${ARTIFACT_FILE} artifact.yaml
  194 + ${ARTIFACT}= load_data_from ${file_path}
  195 + Log ${ARTIFACT.tender_owner_access_token}
  196 + Log ${ARTIFACT.tender_id}
  197 + ${tender}= Call Method ${USERS.users['${username}'].tender_create_client} create_tender
  198 + ... ${ARTIFACT.tender_id}
  199 + ... ${tender_data}
  200 + ... access_token=${ARTIFACT.tender_owner_access_token}
187 201 Log ${tender}
188 202 ${access_token}= Get Variable Value ${tender.access.token}
189 203 ${status}= Set Variable If 'open' in '${MODE}' active.tendering ${EMPTY}
... ... @@ -232,10 +246,10 @@ Library openprocurement_client.utils
232 246
233 247 Створити план
234 248 [Arguments] ${username} ${tender_data}
235   - ${tender}= Call Method ${USERS.users['${username}'].client} create_plan ${tender_data}
  249 + ${tender}= Call Method ${USERS.users['${username}'].plan_client} create_plan ${tender_data}
236 250 Log ${tender}
237 251 ${access_token}= Get Variable Value ${tender.access.token}
238   - ${tender}= Call Method ${USERS.users['${username}'].client} patch_plan
  252 + ${tender}= Call Method ${USERS.users['${username}'].plan_client} patch_plan
239 253 ... ${tender.data.id}
240 254 ... ${tender}
241 255 ... access_token=${tender.access.token}
... ... @@ -399,13 +413,13 @@ Library openprocurement_client.utils
399 413
400 414 Отримати список планів
401 415 [Arguments] ${username}
402   - @{plans_feed}= get_plans_feed ${USERS.users['${username}'].client}
  416 + @{plans_feed}= get_plans_feed ${USERS.users['${username}'].plan_client}
403 417 [return] @{plans_feed}
404 418
405 419
406 420 Отримати план по внутрішньому ідентифікатору
407 421 [Arguments] ${username} ${internalid} ${save_key}=tender_data
408   - ${tender}= Call Method ${USERS.users['${username}'].client} get_plan ${internalid}
  422 + ${tender}= Call Method ${USERS.users['${username}'].plan_client} get_plan ${internalid}
409 423 ${tender}= set_access_key ${tender} ${USERS.users['${username}'].access_token}
410 424 Set To Dictionary ${USERS.users['${username}']} ${save_key}=${tender}
411 425 ${tender}= munch_dict arg=${tender}
... ... @@ -512,7 +526,7 @@ Library openprocurement_client.utils
512 526 ${tender}= openprocurement_client.Пошук плану по ідентифікатору ${username} ${tender_uaid}
513 527 Set_To_Object ${tender.data} ${fieldname} ${fieldvalue}
514 528 ${tender}= set_access_key ${tender} ${USERS.users['${username}'].access_token}
515   - ${tender}= Call Method ${USERS.users['${username}'].client} patch_plan
  529 + ${tender}= Call Method ${USERS.users['${username}'].plan_client} patch_plan
516 530 ... ${tender.data.id}
517 531 ... ${tender}
518 532 ... access_token=${tender.access.token}
... ... @@ -536,11 +550,12 @@ Library openprocurement_client.utils
536 550 [Arguments] ${username} ${tender_uaid} ${item}
537 551 ${tender}= openprocurement_client.Пошук плану по ідентифікатору ${username} ${tender_uaid}
538 552 Append To List ${tender.data['items']} ${item}
539   - Call Method ${USERS.users['${username}'].client} patch_plan
  553 + Call Method ${USERS.users['${username}'].plan_client} patch_plan
540 554 ... ${tender.data.id}
541 555 ... ${tender}
542 556 ... access_token=${tender.access.token}
543 557
  558 +
544 559 Отримати інформацію із предмету
545 560 [Arguments] ${username} ${tender_uaid} ${item_id} ${field_name}
546 561 ${field_name}= Отримати шлях до поля об’єкта ${username} ${field_name} ${item_id}
... ... @@ -563,7 +578,7 @@ Library openprocurement_client.utils
563 578 ${tender}= openprocurement_client.Пошук плану по ідентифікатору ${username} ${tender_uaid}
564 579 ${item_index}= get_object_index_by_id ${tender.data['items']} ${item_id}
565 580 Remove From List ${tender.data['items']} ${item_index}
566   - Call Method ${USERS.users['${username}'].client} patch_plan
  581 + Call Method ${USERS.users['${username}'].plan_client} patch_plan
567 582 ... ${tender.data.id}
568 583 ... ${tender}
569 584 ... access_token=${tender.access.token}
... ...
... ... @@ -11,6 +11,7 @@ from retrying import retry
11 11 from time import sleep
12 12 import os
13 13 import urllib
  14 +from openprocurement_client.resources.tenders import TenderCreateClient
14 15
15 16
16 17 def retry_if_request_failed(exception):
... ... @@ -182,4 +183,16 @@ class StableClient_dasu(DasuClient):
182 183
183 184
184 185 def prepare_dasu_api_wrapper(resource, host_url, api_version, username, password, ds_config=None):
185   - return StableClient_dasu(resource, host_url, api_version, username, password, ds_config=ds_config)
\ No newline at end of file
  186 + return StableClient_dasu(resource, host_url, api_version, username, password, ds_config=ds_config)
  187 +
  188 +
  189 +class StableTenderCreateClient(TenderCreateClient):
  190 + @retry(stop_max_attempt_number=100, wait_random_min=500,
  191 + wait_random_max=4000, retry_on_exception=retry_if_request_failed)
  192 + def request(self, *args, **kwargs):
  193 + return super(StableTenderCreateClient, self).request(*args, **kwargs)
  194 +
  195 +
  196 +def prepare_tender_create_wrapper(key, resource, host_url, api_version, ds_config=None):
  197 + return StableTenderCreateClient(key, resource, host_url, api_version,
  198 + ds_config=ds_config)
\ No newline at end of file
... ...
... ... @@ -10,6 +10,7 @@ ${VAT_INCLUDED} ${True}
10 10 ${NUMBER_OF_MILESTONES} ${1}
11 11 ${ROAD_INDEX} ${False}
12 12 ${GMDN_INDEX} ${False}
  13 +${PLAN_TENDER} ${True}
13 14
14 15 *** Test Cases ***
15 16 Можливість оголосити тендер
... ...
... ... @@ -19,6 +19,7 @@ ${lot_index} ${0}
19 19 ${award_index} ${0}
20 20 ${ROAD_INDEX} ${False}
21 21 ${GMDN_INDEX} ${False}
  22 +${PLAN_TENDER} ${True}
22 23
23 24 *** Test Cases ***
24 25
... ...
... ... @@ -115,9 +115,11 @@ def subtraction(value1, value2):
115 115 def create_fake_value_amount():
116 116 return fake.random_int(min=1)
117 117
  118 +
118 119 def get_number_of_minutes(days, accelerator):
119 120 return 1440 * int(days) / accelerator
120 121
  122 +
121 123 def field_with_id(prefix, sentence):
122 124 return u"{}-{}: {}".format(prefix, fake.uuid4()[:8], sentence)
123 125
... ... @@ -160,6 +162,7 @@ def create_fake_IsoDurationType(
160 162
161 163
162 164 def test_tender_data(params,
  165 + plan_data,
163 166 periods=("enquiry", "tender"),
164 167 submissionMethodDetails=None,
165 168 funders=None,
... ... @@ -215,7 +218,11 @@ def test_tender_data(params,
215 218 inc_dt += timedelta(minutes=params['intervals'][period_name][i])
216 219 period_dict[period_name + "Period"][j + "Date"] = inc_dt.astimezone(TZ).isoformat()
217 220 data.update(period_dict)
218   - if params.get('moz_integration'):
  221 + if params.get('plan_tender'):
  222 + data["procuringEntity"]["name"] = plan_data["data"]["procuringEntity"]["name"]
  223 + data["procuringEntity"]["identifier"] = plan_data["data"]["procuringEntity"]["identifier"]
  224 + cpv_group = plan_data["data"]["classification"]["id"]
  225 + elif params.get('moz_integration'):
219 226 cpv_group = 336
220 227 elif params.get('road_index'):
221 228 cpv_group = 'road'
... ... @@ -295,10 +302,9 @@ def test_tender_data_planning(params):
295 302 "procuringEntity": {
296 303 "identifier": {
297 304 "scheme": "UA-EDR",
298   - "id": str(fake.random_int(min=1, max=999)),
299   - "legalName": fake.description(),
  305 + "id": random.choice(["13313462", "00037256"]),
  306 + "legalName": random.choice([u"Київський Тестовий Ліцей", u"Київська Тестова міська клінічна лікарня"]),
300 307 },
301   - "name": fake.description(),
302 308 },
303 309 "tender": {
304 310 "procurementMethod": "",
... ... @@ -307,10 +313,22 @@ def test_tender_data_planning(params):
307 313 "startDate": get_now().replace(hour=0, minute=0, second=0, microsecond=0).isoformat()
308 314 }
309 315 },
310   - "items": []
  316 + "items": [],
  317 + "buyers": []
311 318 }
312   - id_cpv=fake.cpv()[:4]
313   - cpv_data=test_item_data(id_cpv)
  319 + data["procuringEntity"]["name"] = data["procuringEntity"]["identifier"]["legalName"]
  320 + buyers = test_buyers_data()
  321 + buyers["name"] = buyers["identifier"]["legalName"]
  322 + data['buyers'].append(buyers)
  323 + if params.get('moz_integration'):
  324 + id_cpv = 336
  325 + elif params.get('road_index'):
  326 + id_cpv = fake.road_cpv()[:4]
  327 + elif params.get('gmdn_index'):
  328 + id_cpv = fake.gmdn_cpv()[:4]
  329 + else:
  330 + id_cpv = fake.cpv()[:4]
  331 + cpv_data = test_item_data(id_cpv)
314 332 data.update(cpv_data)
315 333 del data['deliveryDate']
316 334 del data['description']
... ... @@ -321,7 +339,7 @@ def test_tender_data_planning(params):
321 339 del data['quantity']
322 340 del data['unit']
323 341 for i in range(params['number_of_items']):
324   - item_data=test_item_data(id_cpv)
  342 + item_data = test_item_data(id_cpv)
325 343 del item_data['deliveryAddress']
326 344 del item_data['deliveryLocation']
327 345 item_data['deliveryDate']['endDate'] = (get_now() + timedelta(days=10)).replace(hour=0, minute=0, second=0, microsecond=0).isoformat()
... ... @@ -334,8 +352,8 @@ def test_tender_data_planning(params):
334 352 return munchify(data)
335 353
336 354
337   -def test_tender_data_limited(params):
338   - data = test_tender_data(params)
  355 +def test_tender_data_limited(params, plan_data):
  356 + data = test_tender_data(params, plan_data)
339 357 del data["submissionMethodDetails"]
340 358 del data["minimalStep"]
341 359 del data["enquiryPeriod"]
... ... @@ -639,31 +657,31 @@ def test_change_document_data(document, change_id):
639 657 return munchify(document)
640 658
641 659
642   -def test_tender_data_openua(params, submissionMethodDetails):
  660 +def test_tender_data_openua(params, submissionMethodDetails, plan_data):
643 661 # We should not provide any values for `enquiryPeriod` when creating
644 662 # an openUA or openEU procedure. That field should not be present at all.
645 663 # Therefore, we pass a nondefault list of periods to `test_tender_data()`.
646   - data = test_tender_data(params, ('tender',), submissionMethodDetails)
  664 + data = test_tender_data(params, plan_data, ('tender',), submissionMethodDetails)
647 665 data['procurementMethodType'] = 'aboveThresholdUA'
648 666 data['procuringEntity']['kind'] = 'general'
649 667 return data
650 668
651 669
652   -def test_tender_data_openua_defense(params, submissionMethodDetails):
  670 +def test_tender_data_openua_defense(params, submissionMethodDetails, plan_data):
653 671 """We should not provide any values for `enquiryPeriod` when creating
654 672 an openUA, openEU or openUA_defense procedure. That field should not be present at all.
655 673 Therefore, we pass a nondefault list of periods to `test_tender_data()`."""
656   - data = test_tender_data(params, ('tender',), submissionMethodDetails)
  674 + data = test_tender_data(params, plan_data, ('tender',), submissionMethodDetails)
657 675 data['procurementMethodType'] = 'aboveThresholdUA.defense'
658 676 data['procuringEntity']['kind'] = 'defense'
659 677 return data
660 678
661 679
662   -def test_tender_data_openeu(params, submissionMethodDetails):
  680 +def test_tender_data_openeu(params, submissionMethodDetails, plan_data):
663 681 # We should not provide any values for `enquiryPeriod` when creating
664 682 # an openUA or openEU procedure. That field should not be present at all.
665 683 # Therefore, we pass a nondefault list of periods to `test_tender_data()`.
666   - data = test_tender_data(params, ('tender',), submissionMethodDetails)
  684 + data = test_tender_data(params, plan_data, ('tender',), submissionMethodDetails)
667 685 data['procurementMethodType'] = 'aboveThresholdEU'
668 686 data['title_en'] = "[TESTING]"
669 687 for item_number, item in enumerate(data['items']):
... ... @@ -676,8 +694,8 @@ def test_tender_data_openeu(params, submissionMethodDetails):
676 694 return data
677 695
678 696
679   -def test_tender_data_framework_agreement(params, submissionMethodDetails):
680   - data = test_tender_data_openeu(params, submissionMethodDetails)
  697 +def test_tender_data_framework_agreement(params, submissionMethodDetails, plan_data):
  698 + data = test_tender_data_openeu(params, submissionMethodDetails, plan_data)
681 699 data['procurementMethodType'] = 'closeFrameworkAgreementUA'
682 700 data['maxAwardsCount'] = fake.random_int(min=3, max=5)
683 701 data['agreementDuration'] = create_fake_IsoDurationType(
... ... @@ -691,11 +709,11 @@ def test_tender_data_framework_agreement(params, submissionMethodDetails):
691 709 return data
692 710
693 711
694   -def test_tender_data_competitive_dialogue(params, submissionMethodDetails):
  712 +def test_tender_data_competitive_dialogue(params, submissionMethodDetails, plan_data):
695 713 # We should not provide any values for `enquiryPeriod` when creating
696 714 # an openUA or openEU procedure. That field should not be present at all.
697 715 # Therefore, we pass a nondefault list of periods to `test_tender_data()`.
698   - data = test_tender_data(params, ('tender',), submissionMethodDetails)
  716 + data = test_tender_data(params, plan_data, ('tender',), submissionMethodDetails)
699 717 if params.get('dialogue_type') == 'UA':
700 718 data['procurementMethodType'] = 'competitiveDialogueUA'
701 719 else:
... ... @@ -843,8 +861,8 @@ def test_elimination_report(corruption, relatedParty_id):
843 861 })
844 862
845 863
846   -def test_tender_data_esco(params, submissionMethodDetails):
847   - data = test_tender_data(params, ('tender',), submissionMethodDetails)
  864 +def test_tender_data_esco(params, submissionMethodDetails, plan_data):
  865 + data = test_tender_data(params, plan_data, ('tender',), submissionMethodDetails)
848 866 data['procurementMethodType'] = 'esco'
849 867 data['title_en'] = "[TESTING]"
850 868 for item_number, item in enumerate(data['items']):
... ... @@ -918,16 +936,37 @@ def invalid_INN_data():
918 936 def invalid_cost_data():
919 937 return munchify({
920 938 "scheme": "UA-ROAD",
921   - "id": "М-15",
922   - "description": "Одеса - Рені (на м. Бухарест)"
  939 + "id": "Н-08",
  940 + "description": "Бориспіль - Дніпро - Запоріжжя (через м. Кременчук) - Маріуполь"
923 941 })
924 942
925 943
926 944 def invalid_gmdn_data():
927 945 return munchify({
928 946 "scheme": "GMDN",
929   - "id": "33110",
930   - "description": "Коліматор радіонуклідної системи, високоенергетичний"
  947 + "id": "10082",
  948 + "description": "Змішувач амальгами для стоматології"
931 949 })
932 950
933 951
  952 +def test_buyers_data():
  953 + buyers = {
  954 + "identifier": {
  955 + "scheme": "UA-EDR",
  956 + "id": random.choice(["13313462", "00037256"]),
  957 + "legalName": random.choice([u"Київський Тестовий Ліцей", u"Київська Тестова міська клінічна лікарня"]),
  958 + }
  959 + }
  960 + return munchify(buyers)
  961 +
  962 +
  963 +def invalid_buyers_data():
  964 + buyers = {
  965 + "identifier": {
  966 + "scheme": "UA-EDR",
  967 + "id": "13313462",
  968 + "legalName": "Київський Тестовий Ліцей",
  969 + },
  970 + "name": "Київський Тестовий Ліцей"
  971 + }
  972 + return munchify(buyers)
... ...
... ... @@ -213,12 +213,12 @@ Get Broker Property By Username
213 213
214 214
215 215 Підготувати дані для створення тендера
216   - [Arguments] ${tender_parameters}
  216 + [Arguments] ${tender_parameters} ${plan_data}
217 217 ${period_intervals}= compute_intrs ${BROKERS} ${used_brokers}
218 218 ${submissionMethodDetails}= Get Variable Value ${submissionMethodDetails}
219 219 ${accelerator}= Get Variable Value ${accelerator}
220 220 ${funders}= Get Variable Value ${FUNDERS}
221   - ${tender_data}= prepare_test_tender_data ${period_intervals} ${tender_parameters} ${submissionMethodDetails} ${accelerator} ${funders}
  221 + ${tender_data}= prepare_test_tender_data ${period_intervals} ${tender_parameters} ${submissionMethodDetails} ${accelerator} ${funders} ${plan_data}
222 222 ${TENDER}= Create Dictionary
223 223 Set Global Variable ${TENDER}
224 224 Log ${tender_data}
... ...
... ... @@ -19,6 +19,7 @@ ${MOZ_INTEGRATION} ${False}
19 19 ${VAT_INCLUDED} ${True}
20 20 ${ROAD_INDEX} ${False}
21 21 ${GMDN_INDEX} ${False}
  22 +${PLAN_TENDER} ${True}
22 23
23 24 *** Test Cases ***
24 25 Можливість оголосити тендер
... ...
... ... @@ -18,6 +18,7 @@ ${MOZ_INTEGRATION} ${False}
18 18 ${VAT_INCLUDED} ${True}
19 19 ${ROAD_INDEX} ${False}
20 20 ${GMDN_INDEX} ${False}
  21 +${PLAN_TENDER} ${True}
21 22
22 23 *** Test Cases ***
23 24 ##############################################################################################
... ...
... ... @@ -18,6 +18,7 @@ ${MOZ_INTEGRATION} ${False}
18 18 ${VAT_INCLUDED} ${True}
19 19 ${ROAD_INDEX} ${False}
20 20 ${GMDN_INDEX} ${False}
  21 +${PLAN_TENDER} ${True}
21 22
22 23 *** Test Cases ***
23 24 ##############################################################################################
... ...
... ... @@ -167,6 +167,10 @@ class OP_Provider(BaseProvider):
167 167 for cpv_element in self.cpvs:
168 168 if cpv_element.startswith(cpv_group):
169 169 similar_cpvs.append(cpv_element)
  170 + else:
  171 + for cpv_element in self.moz_cpvs:
  172 + if cpv_element.startswith(cpv_group):
  173 + similar_cpvs.append(cpv_element)
170 174 cpv = self.random_element(similar_cpvs)
171 175 for entity in self.items_base_data:
172 176 if entity["cpv_id"] == cpv:
... ...
... ... @@ -20,6 +20,7 @@ ${MOZ_INTEGRATION} ${False}
20 20 ${VAT_INCLUDED} ${True}
21 21 ${ROAD_INDEX} ${False}
22 22 ${GMDN_INDEX} ${False}
  23 +${PLAN_TENDER} ${True}
23 24
24 25 *** Test Cases ***
25 26 Можливість оголосити тендер
... ... @@ -222,6 +223,46 @@ ${GMDN_INDEX} ${False}
222 223 Run Keyword And Expect Error * Можливість оголосити тендер з використанням валідації класифікатор медичних виробів ${6}
223 224
224 225
  226 +Неможливість опублікувати тендер на закупівлю з невідповідним кодом ЄДРПОУ
  227 + [Tags] ${USERS.users['${tender_owner}'].broker}: Оголошення тендера
  228 + ... tender_owner
  229 + ... ${USERS.users['${tender_owner}'].broker}
  230 + ... create_tender_invalid_edrpou level1
  231 + ... critical
  232 + [Teardown] Оновити LAST_MODIFICATION_DATE
  233 + Run Keyword And Expect Error * Можливість оголосити тендер з використанням валідації план-тендер ${1}
  234 +
  235 +
  236 +Неможливість опублікувати тендер на закупівлю з невідповідною схемою
  237 + [Tags] ${USERS.users['${tender_owner}'].broker}: Оголошення тендера
  238 + ... tender_owner
  239 + ... ${USERS.users['${tender_owner}'].broker}
  240 + ... create_tender_invalid_schema level1
  241 + ... critical
  242 + [Teardown] Оновити LAST_MODIFICATION_DATE
  243 + Run Keyword And Expect Error * Можливість оголосити тендер з використанням валідації план-тендер ${2}
  244 +
  245 +
  246 +Неможливість опублікувати тендер на закупівлю з невідповідним cpv кодом
  247 + [Tags] ${USERS.users['${tender_owner}'].broker}: Оголошення тендера
  248 + ... tender_owner
  249 + ... ${USERS.users['${tender_owner}'].broker}
  250 + ... create_tender_invalid_cpv level1
  251 + ... critical
  252 + [Teardown] Оновити LAST_MODIFICATION_DATE
  253 + Run Keyword And Expect Error * Можливість оголосити тендер з використанням валідації план-тендер ${3}
  254 +
  255 +
  256 +Неможливість опублікувати тендер на закупівлю з невідповідним cpv кодом
  257 + [Tags] ${USERS.users['${tender_owner}'].broker}: Оголошення тендера
  258 + ... tender_owner
  259 + ... ${USERS.users['${tender_owner}'].broker}
  260 + ... create_tender_invalid_procurementMethodType level1
  261 + ... critical
  262 + [Teardown] Оновити LAST_MODIFICATION_DATE
  263 + Run Keyword And Expect Error * Можливість оголосити тендер з використанням валідації план-тендер ${4}
  264 +
  265 +
225 266 Можливість знайти тендер по ідентифікатору
226 267 [Tags] ${USERS.users['${viewer}'].broker}: Пошук тендера
227 268 ... viewer tender_owner provider provider1
... ...
... ... @@ -11,6 +11,9 @@ ${MODE} belowThreshold
11 11 ${NUMBER_OF_ITEMS} ${2}
12 12 ${TENDER_MEAT} ${False}
13 13 ${ITEM_MEAT} ${False}
  14 +${MOZ_INTEGRATION} ${False}
  15 +${ROAD_INDEX} ${False}
  16 +${GMDN_INDEX} ${False}
14 17
15 18 *** Test Cases ***
16 19 Можливість створити план закупівлі
... ... @@ -23,6 +26,24 @@ ${ITEM_MEAT} ${False}
23 26 Можливість створити план закупівлі
24 27
25 28
  29 +Можливість створити план закупівлі з двома buyers
  30 + [Tags] ${USERS.users['${tender_owner}'].broker}: Оголошення плану
  31 + ... tender_owner
  32 + ... ${USERS.users['${tender_owner}'].broker}
  33 + ... create_plan_two_buyers
  34 + ... critical
  35 + Run Keyword And Expect Error * Можливість створити план закупівлі з використанням валідації для buyers ${1}
  36 +
  37 +
  38 +Можливість створити план закупівлі з порожнім buyers
  39 + [Tags] ${USERS.users['${tender_owner}'].broker}: Оголошення плану
  40 + ... tender_owner
  41 + ... ${USERS.users['${tender_owner}'].broker}
  42 + ... create_plan_no_buyers
  43 + ... critical
  44 + Run Keyword And Expect Error * Можливість створити план закупівлі з використанням валідації для buyers ${2}
  45 +
  46 +
26 47 Можливість знайти план по ідентифікатору
27 48 [Tags] ${USERS.users['${viewer}'].broker}: Пошук плану
28 49 ... viewer tender_owner
... ...
... ... @@ -18,6 +18,7 @@ ${MOZ_INTEGRATION} ${False}
18 18 ${VAT_INCLUDED} ${True}
19 19 ${ROAD_INDEX} ${False}
20 20 ${GMDN_INDEX} ${False}
  21 +${PLAN_TENDER} ${True}
21 22
22 23 *** Test Cases ***
23 24 ##############################################################################################
... ...
... ... @@ -77,7 +77,8 @@ from .initial_data import (
77 77 get_hash,
78 78 invalid_INN_data,
79 79 invalid_cost_data,
80   - invalid_gmdn_data
  80 + invalid_gmdn_data,
  81 + invalid_buyers_data
81 82 )
82 83 from barbecue import chef
83 84 from restkit import request
... ... @@ -320,7 +321,8 @@ def prepare_test_tender_data(procedure_intervals,
320 321 tender_parameters,
321 322 submissionMethodDetails,
322 323 accelerator,
323   - funders):
  324 + funders,
  325 + plan_data):
324 326 # Get actual intervals by mode name
325 327 mode = tender_parameters['mode']
326 328 if mode in procedure_intervals:
... ... @@ -337,35 +339,37 @@ def prepare_test_tender_data(procedure_intervals,
337 339 assert intervals['accelerator'] >= 0, \
338 340 "Accelerator should not be less than 0"
339 341 if mode == 'negotiation':
340   - return munchify({'data': test_tender_data_limited(tender_parameters)})
  342 + return munchify({'data': test_tender_data_limited(tender_parameters, plan_data)})
341 343 elif mode == 'negotiation.quick':
342   - return munchify({'data': test_tender_data_limited(tender_parameters)})
  344 + return munchify({'data': test_tender_data_limited(tender_parameters, plan_data)})
343 345 elif mode == 'openeu':
344 346 return munchify({'data': test_tender_data_openeu(
345   - tender_parameters, submissionMethodDetails)})
  347 + tender_parameters, submissionMethodDetails, plan_data)})
346 348 elif mode == 'openua':
347 349 return munchify({'data': test_tender_data_openua(
348   - tender_parameters, submissionMethodDetails)})
  350 + tender_parameters, submissionMethodDetails, plan_data)})
349 351 elif mode == 'openua_defense':
350 352 return munchify({'data': test_tender_data_openua_defense(
351   - tender_parameters, submissionMethodDetails)})
  353 + tender_parameters, submissionMethodDetails, plan_data)})
352 354 elif mode == 'open_competitive_dialogue':
353 355 return munchify({'data': test_tender_data_competitive_dialogue(
354   - tender_parameters, submissionMethodDetails)})
  356 + tender_parameters, submissionMethodDetails, plan_data)})
355 357 elif mode == 'reporting':
356   - return munchify({'data': test_tender_data_limited(tender_parameters)})
  358 + return munchify({'data': test_tender_data_limited(tender_parameters, plan_data)})
357 359 elif mode == 'open_framework':
358 360 return munchify({'data': test_tender_data_framework_agreement(
359   - tender_parameters, submissionMethodDetails)})
  361 + tender_parameters, submissionMethodDetails, plan_data)})
360 362 elif mode == 'belowThreshold':
361 363 return munchify({'data': test_tender_data(
362 364 tender_parameters,
  365 + plan_data,
363 366 submissionMethodDetails=submissionMethodDetails,
364 367 funders=funders,
365   - accelerator=accelerator)})
  368 + accelerator=accelerator,
  369 + )})
366 370 elif mode == 'open_esco':
367 371 return munchify({'data': test_tender_data_esco(
368   - tender_parameters, submissionMethodDetails)})
  372 + tender_parameters, submissionMethodDetails, plan_data)})
369 373 # The previous line needs an explicit keyword argument because,
370 374 # unlike previous functions, this one has three arguments.
371 375 raise ValueError("Invalid mode for prepare_test_tender_data")
... ... @@ -678,23 +682,17 @@ def edit_tender_data_for_mnn(data, mode, data_version):
678 682 id = {1: '33600000-6', 2: '33632100-0', 3: '33632100-0', 4: '33622200-8', 5: '33600000-6', 6: '33692500-2', 7: '33600000-6', 8: '33615100-5'}
679 683 dict_data = unmunchify(data)
680 684 dict_data['data']['items'][0]['classification']['id'] = id[data_version]
681   -
682 685 if data_version is 3:
683 686 dict_data['data']['items'][0].pop('additionalClassifications', None)
684   -
685 687 if data_version is 4:
686 688 add_INN = invalid_INN_data()
687 689 dict_data['data']['items'][0]['additionalClassifications'].append(add_INN)
688   -
689 690 if data_version is 5:
690 691 dict_data['data']['items'][0].pop('additionalClassifications', None)
691   -
692 692 if data_version is 6:
693 693 dict_data['data']['items'][0]['additionalClassifications'].pop(0)
694   -
695 694 if data_version is 7:
696 695 dict_data['data']['items'][0]['additionalClassifications'].pop(1)
697   -
698 696 if data_version is 8:
699 697 dict_data['data']['items'][0]['additionalClassifications'].pop(1)
700 698 return munchify(dict_data)
... ... @@ -703,20 +701,15 @@ def edit_tender_data_for_mnn(data, mode, data_version):
703 701 def edit_tender_data_for_cost(data, mode, data_version):
704 702 test_data = {3: 'PQ-17', 4: 'Дорога'}
705 703 dict_data = unmunchify(data)
706   -
707 704 if data_version is 1:
708 705 dict_data['data']['items'][0].pop('additionalClassifications', None)
709   -
710 706 if data_version is 2:
711 707 add_cost = invalid_cost_data()
712 708 dict_data['data']['items'][0]['additionalClassifications'].append(add_cost)
713   -
714 709 if data_version is 3:
715 710 dict_data['data']['items'][0]['additionalClassifications'][0]['id'] = test_data[data_version]
716   -
717 711 if data_version is 4:
718 712 dict_data['data']['items'][0]['additionalClassifications'][0]['description'] = test_data[data_version]
719   -
720 713 if data_version is 5:
721 714 add_cost = invalid_cost_data()
722 715 dict_data['data']['items'][0]['additionalClassifications'][0] = add_cost
... ... @@ -726,27 +719,43 @@ def edit_tender_data_for_cost(data, mode, data_version):
726 719 def edit_tender_data_for_gmdn(data, mode, data_version):
727 720 gmdn_test_data = {3: '9999', 4: 'Виріб'}
728 721 dict_data = unmunchify(data)
729   -
730 722 if data_version is 1:
731 723 dict_data['data']['items'][0].pop('additionalClassifications', None)
732   -
733 724 if data_version is 2:
734 725 add_gmdn = invalid_gmdn_data()
735 726 dict_data['data']['items'][0]['additionalClassifications'].append(add_gmdn)
736   -
737 727 if data_version is 3:
738 728 dict_data['data']['items'][0]['additionalClassifications'][0]['id'] = gmdn_test_data[data_version]
739   -
740 729 if data_version is 4:
741 730 dict_data['data']['items'][0]['additionalClassifications'][0]['description'] = gmdn_test_data[data_version]
742   -
743 731 if data_version is 5:
744 732 add_gmdn = invalid_gmdn_data()
745 733 dict_data['data']['items'][0]['additionalClassifications'][0] = add_gmdn
746   -
747 734 if data_version is 6:
748 735 add_INN = invalid_INN_data()
749 736 dict_data['data']['items'][0]['additionalClassifications'].append(add_INN)
750 737 return munchify(dict_data)
751 738
752 739
  740 +def edit_plan_buyers(data, data_version):
  741 + dict_data = unmunchify(data)
  742 + if data_version is 1:
  743 + add_buyer = invalid_buyers_data()
  744 + dict_data['data']['buyers'].append(add_buyer)
  745 + if data_version is 2:
  746 + dict_data['data'].pop('buyers')
  747 + return munchify(dict_data)
  748 +
  749 +
  750 +def edit_tender_data_for_plan_tender(data, mode, data_version):
  751 + plan_tedner_test_data = {1: '03222111-4', 2: 'UA-FIN', 3: '11112222', 4: 'aboveThresholdEU'}
  752 + dict_data = unmunchify(data)
  753 + if data_version is 1:
  754 + dict_data['data']['items'][0]['classification']['id'] = plan_tedner_test_data[data_version]
  755 + if data_version is 2:
  756 + dict_data['data']['procuringEntity']['identifier']['scheme'] = plan_tedner_test_data[data_version]
  757 + if data_version is 3:
  758 + dict_data['data']['procuringEntity']['identifier']['id'] = plan_tedner_test_data[data_version]
  759 + if data_version is 4:
  760 + dict_data['data']['procurementMethodType'] = plan_tedner_test_data[data_version]
  761 + return munchify(dict_data)
... ...
  1 +-v MODE:belowThreshold
  2 +
  3 +-v NUMBER_OF_ITEMS:2
  4 +
  5 +-v TENDER_MEAT:False
  6 +-v ITEM_MEAT:False
  7 +-v LOT_MEAT:False
  8 +
  9 +-i create_plan
  10 +-i find_plan
  11 +
  12 +-i plan_view
  13 +
  14 +-i modify_plan
  15 +
  16 +-i add_item
  17 +-i delete_item
\ No newline at end of file
... ...
Please register or login to post a comment