Showing
3 changed files
with
55 additions
and
1 deletions
@@ -151,6 +151,56 @@ def test_tender_data(params, | @@ -151,6 +151,56 @@ def test_tender_data(params, | ||
151 | return munchify(data) | 151 | return munchify(data) |
152 | 152 | ||
153 | 153 | ||
154 | +def test_tender_data_planning(params): | ||
155 | + data = { | ||
156 | + "budget": { | ||
157 | + "amountNet": round(random.uniform(3000, 999999999.99), 2), | ||
158 | + "description": fake.description(), | ||
159 | + "project": { | ||
160 | + "id": str(fake.random_int(min=1, max=999)), | ||
161 | + "name": fake.description(), | ||
162 | + }, | ||
163 | + "currency": "UAH", | ||
164 | + "amount": round(random.uniform(3000, 99999999999.99), 2), | ||
165 | + "id": str(fake.random_int(min=1, max=99999999999)) + "-" + str(fake.random_int(min=1, max=9)), | ||
166 | + }, | ||
167 | + "procuringEntity": { | ||
168 | + "identifier": { | ||
169 | + "scheme": "UA-EDR", | ||
170 | + "id": str(fake.random_int(min=1, max=999)), | ||
171 | + "legalName": fake.description(), | ||
172 | + }, | ||
173 | + "name": fake.description(), | ||
174 | + }, | ||
175 | + "tender": { | ||
176 | + "procurementMethod": "open", | ||
177 | + "procurementMethodType": "belowThreshold", | ||
178 | + "tenderPeriod": { | ||
179 | + "startDate": (get_now().isoformat()) | ||
180 | + } | ||
181 | + }, | ||
182 | + "items": [] | ||
183 | + } | ||
184 | + id_cpv=fake.cpv()[:4] | ||
185 | + cpv_data=test_item_data(id_cpv) | ||
186 | + data.update(cpv_data) | ||
187 | + del data['deliveryDate'] | ||
188 | + del data['description'] | ||
189 | + del data['description_en'] | ||
190 | + del data['description_ru'] | ||
191 | + del data['deliveryAddress'] | ||
192 | + del data['deliveryLocation'] | ||
193 | + del data['quantity'] | ||
194 | + del data['unit'] | ||
195 | + for i in range(params['number_of_items']): | ||
196 | + item_data=test_item_data(id_cpv) | ||
197 | + del item_data['deliveryAddress'] | ||
198 | + del item_data['deliveryLocation'] | ||
199 | + del item_data['deliveryDate']['startDate'] | ||
200 | + data['items'].append(item_data) | ||
201 | + return munchify(data) | ||
202 | + | ||
203 | + | ||
154 | def test_tender_data_limited(params): | 204 | def test_tender_data_limited(params): |
155 | data = test_tender_data(params) | 205 | data = test_tender_data(params) |
156 | del data["submissionMethodDetails"] | 206 | del data["submissionMethodDetails"] |
@@ -149,4 +149,4 @@ class OP_Provider(BaseProvider): | @@ -149,4 +149,4 @@ class OP_Provider(BaseProvider): | ||
149 | "description_ru": item_base_data["description_ru"], | 149 | "description_ru": item_base_data["description_ru"], |
150 | "description_en": item_base_data["description_en"] | 150 | "description_en": item_base_data["description_en"] |
151 | }) | 151 | }) |
152 | - return deepcopy(item) | 152 | + return deepcopy(item) |
@@ -44,6 +44,7 @@ from .initial_data import ( | @@ -44,6 +44,7 @@ from .initial_data import ( | ||
44 | test_tender_data_limited, | 44 | test_tender_data_limited, |
45 | test_tender_data_openeu, | 45 | test_tender_data_openeu, |
46 | test_tender_data_openua, | 46 | test_tender_data_openua, |
47 | + test_tender_data_planning, | ||
47 | ) | 48 | ) |
48 | from barbecue import chef | 49 | from barbecue import chef |
49 | from restkit import request | 50 | from restkit import request |
@@ -317,6 +318,9 @@ def prepare_test_tender_data(procedure_intervals, | @@ -317,6 +318,9 @@ def prepare_test_tender_data(procedure_intervals, | ||
317 | return munchify({'data': test_tender_data( | 318 | return munchify({'data': test_tender_data( |
318 | tender_parameters, | 319 | tender_parameters, |
319 | submissionMethodDetails=submissionMethodDetails)}) | 320 | submissionMethodDetails=submissionMethodDetails)}) |
321 | + elif mode == 'planning': | ||
322 | + return munchify({'data': test_tender_data_planning( | ||
323 | + tender_parameters)}) | ||
320 | # The previous line needs an explicit keyword argument because, | 324 | # The previous line needs an explicit keyword argument because, |
321 | # unlike previous functions, this one has three arguments. | 325 | # unlike previous functions, this one has three arguments. |
322 | raise ValueError("Invalid mode for prepare_test_tender_data") | 326 | raise ValueError("Invalid mode for prepare_test_tender_data") |
Please
register
or
login
to post a comment