Commit 8441602fc0edc19d297a63aa1d9efc326dce8823
1 parent
c5d46807
added initial data for Prom, fixed coordinates, Unit Codes
Showing
1 changed file
with
285 additions
and
16 deletions
| ... | ... | @@ -13,7 +13,7 @@ def test_tender_data(): |
| 13 | 13 | "title": fake.catch_phrase(), |
| 14 | 14 | "mode": "test", |
| 15 | 15 | "submissionMethodDetails": "quick", |
| 16 | - "description": "Тестовий тендер", | |
| 16 | + "description": "Test tender1", #Error @prom when 'Тестовый тендер' | |
| 17 | 17 | "description_en": "Test tender", |
| 18 | 18 | "description_ru": "Тестовый тендер", |
| 19 | 19 | "procuringEntity": { |
| ... | ... | @@ -38,11 +38,11 @@ def test_tender_data(): |
| 38 | 38 | } |
| 39 | 39 | }, |
| 40 | 40 | "value": { |
| 41 | - "amount": 50000.99, | |
| 41 | + "amount": 50000, #Error @prom when float '50000.99' | |
| 42 | 42 | "currency": u"UAH" |
| 43 | 43 | }, |
| 44 | 44 | "minimalStep": { |
| 45 | - "amount": 100.1, | |
| 45 | + "amount": 100, #Error @prom when float '100.1' | |
| 46 | 46 | "currency": u"UAH" |
| 47 | 47 | }, |
| 48 | 48 | "items": [ |
| ... | ... | @@ -75,21 +75,106 @@ def test_tender_data(): |
| 75 | 75 | } |
| 76 | 76 | ], |
| 77 | 77 | "unit": { |
| 78 | - "name": u"item", | |
| 79 | - "code": u"44617100-9" | |
| 78 | + "name": u"кілограм", | |
| 79 | + "code": u"KGM" | |
| 80 | 80 | }, |
| 81 | 81 | "quantity": fake.pyint() |
| 82 | 82 | } |
| 83 | 83 | ], |
| 84 | 84 | "enquiryPeriod": { |
| 85 | - "endDate": (now + timedelta(minutes=2)).isoformat() | |
| 85 | + "endDate": (now + timedelta(minutes=3)).isoformat() | |
| 86 | 86 | }, |
| 87 | 87 | "tenderPeriod": { |
| 88 | - "endDate": (now + timedelta(minutes=5)).isoformat() | |
| 88 | + "startDate": (now + timedelta(minutes=5)).isoformat(), | |
| 89 | + "endDate": (now + timedelta(minutes=7)).isoformat() | |
| 90 | + } | |
| 91 | +} | |
| 92 | + | |
| 93 | +def prom_tender_data(): | |
| 94 | + now = datetime.now() | |
| 95 | + return { | |
| 96 | + "title": fake.catch_phrase(), | |
| 97 | + "mode": "test", | |
| 98 | + "submissionMethodDetails": "quick", | |
| 99 | + "description": "Test tender1", #Error @prom when 'Тестовый тендер' | |
| 100 | + "description_en": "Test tender", | |
| 101 | + "description_ru": "Тестовый тендер", | |
| 102 | + "procuringEntity": { | |
| 103 | + "name": fake.company(), | |
| 104 | + "name_ru": fake_ru.company(), | |
| 105 | + "name_en": fake_en.company(), | |
| 106 | + "identifier": { | |
| 107 | + "scheme": u"UA-EDR", | |
| 108 | + "id": u"0000{}".format(fake.pyint()), | |
| 109 | + "uri": fake.image_url(width=None, height=None) | |
| 110 | + }, | |
| 111 | + "address": { | |
| 112 | + "countryName": u"Україна", | |
| 113 | + "postalCode": fake.postalcode(), | |
| 114 | + "region": u"м. Київ", | |
| 115 | + "locality": u"м. Київ", | |
| 116 | + "streetAddress": fake.street_address() | |
| 117 | + }, | |
| 118 | + "contactPoint": { | |
| 119 | + "name": fake.name(), | |
| 120 | + "telephone": fake.phone_number() | |
| 121 | + } | |
| 122 | + }, | |
| 123 | + "value": { | |
| 124 | + "amount": 50000, #Error @prom when float '50000.99' | |
| 125 | + "currency": u"UAH" | |
| 126 | + }, | |
| 127 | + "minimalStep": { | |
| 128 | + "amount": 100, #Error @prom when float '100.1' | |
| 129 | + "currency": u"UAH" | |
| 130 | + }, | |
| 131 | + "items": [ | |
| 132 | + { | |
| 133 | + "description": fake.catch_phrase(), | |
| 134 | + "deliveryDate": { | |
| 135 | + "endDate": (now + timedelta(days=5)).isoformat() | |
| 136 | + }, | |
| 137 | + "deliveryLocation": { | |
| 138 | + "latitude": "49.8500° N", | |
| 139 | + "longitude": "24.0167° E" | |
| 140 | + }, | |
| 141 | + "deliveryAddress": { | |
| 142 | + "countryName": u"Україна", | |
| 143 | + "postalCode": fake.postalcode(), | |
| 144 | + "region": u"м. Київ", | |
| 145 | + "locality": u"м. Київ", | |
| 146 | + "streetAddress": fake.street_address() | |
| 147 | + }, | |
| 148 | + "classification": { | |
| 149 | + "scheme": u"CPV", | |
| 150 | + "id": u"44617100-9", | |
| 151 | + "description": u"Cartons" | |
| 152 | + }, | |
| 153 | + "additionalClassifications": [ | |
| 154 | + { | |
| 155 | + "scheme": u"ДКПП", | |
| 156 | + "id": u"17.21.1", | |
| 157 | + "description": u"папір і картон гофровані, паперова й картонна тара" | |
| 158 | + } | |
| 159 | + ], | |
| 160 | + "unit": { | |
| 161 | + "name": u"кілограм", | |
| 162 | + "code": u"KGM" | |
| 163 | + }, | |
| 164 | + "quantity": fake.pyint() | |
| 165 | + } | |
| 166 | + ], | |
| 167 | + "enquiryPeriod": { | |
| 168 | + "startDate": (now + timedelta(minutes=1)).isoformat(), | |
| 169 | + "endDate": (now + timedelta(minutes=3)).isoformat() | |
| 170 | + }, | |
| 171 | + "tenderPeriod": { | |
| 172 | + "startDate": (now + timedelta(minutes=5)).isoformat(), | |
| 173 | + "endDate": (now + timedelta(minutes=36)).isoformat() | |
| 89 | 174 | } |
| 90 | 175 | } |
| 91 | 176 | |
| 92 | -def test_tender_data_multiple_lots(): | |
| 177 | +def test_tender_data_multiple_lots1(): | |
| 93 | 178 | now = datetime.now() |
| 94 | 179 | return { |
| 95 | 180 | "title": fake.catch_phrase(), |
| ... | ... | @@ -134,8 +219,8 @@ def test_tender_data_multiple_lots(): |
| 134 | 219 | "endDate": (now + timedelta(days=5)).isoformat() |
| 135 | 220 | }, |
| 136 | 221 | "deliveryLocation": { |
| 137 | - "latitude": "49.8500° N", | |
| 138 | - "longitude": "24.0167° E" | |
| 222 | + "latitude": 49.8500, | |
| 223 | + "longitude": 24.0167 | |
| 139 | 224 | }, |
| 140 | 225 | "deliveryAddress": { |
| 141 | 226 | "countryName": u"Україна", |
| ... | ... | @@ -157,8 +242,8 @@ def test_tender_data_multiple_lots(): |
| 157 | 242 | } |
| 158 | 243 | ], |
| 159 | 244 | "unit": { |
| 160 | - "name": u"item", | |
| 161 | - "code": u"44617100-9" | |
| 245 | + "name": u"кілограм", | |
| 246 | + "code": u"KGM" | |
| 162 | 247 | }, |
| 163 | 248 | "quantity": fake.pyint() |
| 164 | 249 | }, |
| ... | ... | @@ -168,8 +253,8 @@ def test_tender_data_multiple_lots(): |
| 168 | 253 | "endDate": (now + timedelta(days=5)).isoformat() |
| 169 | 254 | }, |
| 170 | 255 | "deliveryLocation": { |
| 171 | - "latitude": "49.8500° N", | |
| 172 | - "longitude": "24.0167° E" | |
| 256 | + "latitude": 49.8500, | |
| 257 | + "longitude": 24.0167 | |
| 173 | 258 | }, |
| 174 | 259 | "deliveryAddress": { |
| 175 | 260 | "countryName": u"Україна", |
| ... | ... | @@ -191,8 +276,8 @@ def test_tender_data_multiple_lots(): |
| 191 | 276 | } |
| 192 | 277 | ], |
| 193 | 278 | "unit": { |
| 194 | - "name": u"item", | |
| 195 | - "code": u"2-44617100-9" | |
| 279 | + "name": u"кілограм", | |
| 280 | + "code": u"KGM" | |
| 196 | 281 | }, |
| 197 | 282 | "quantity": fake.pyint() |
| 198 | 283 | } |
| ... | ... | @@ -205,6 +290,190 @@ def test_tender_data_multiple_lots(): |
| 205 | 290 | } |
| 206 | 291 | } |
| 207 | 292 | |
| 293 | +def test_tender_data_multiple_lots(): | |
| 294 | + now = datetime.now() | |
| 295 | + return { | |
| 296 | + "title": fake.catch_phrase(), | |
| 297 | + "mode": "test", | |
| 298 | + "submissionMethodDetails": "quick", | |
| 299 | + "description": "Тестовий тендер", | |
| 300 | + "description_en": "Test tender", | |
| 301 | + "description_ru": "Тестовый тендер", | |
| 302 | + "procuringEntity": { | |
| 303 | + "name": fake.company(), | |
| 304 | + "name_ru": fake_ru.company(), | |
| 305 | + "name_en": fake_en.company(), | |
| 306 | + "identifier": { | |
| 307 | + "scheme": u"UA-EDR", | |
| 308 | + "id": u"0000{}".format(fake.pyint()), | |
| 309 | + "uri": fake.image_url(width=None, height=None) | |
| 310 | + }, | |
| 311 | + "address": { | |
| 312 | + "countryName": u"Україна", | |
| 313 | + "postalCode": fake.postalcode(), | |
| 314 | + "region": u"м. Київ", | |
| 315 | + "locality": u"м. Київ", | |
| 316 | + "streetAddress": fake.street_address() | |
| 317 | + }, | |
| 318 | + "contactPoint": { | |
| 319 | + "name": fake.name(), | |
| 320 | + "telephone": fake.phone_number() | |
| 321 | + } | |
| 322 | + }, | |
| 323 | + "value": { | |
| 324 | + "amount": 50000.99, | |
| 325 | + "currency": u"UAH" | |
| 326 | + }, | |
| 327 | + "minimalStep": { | |
| 328 | + "amount": 100.1, | |
| 329 | + "currency": u"UAH" | |
| 330 | + }, | |
| 331 | + "items": [ | |
| 332 | + { | |
| 333 | + "description": fake.catch_phrase(), | |
| 334 | + "deliveryDate": { | |
| 335 | + "endDate": (now + timedelta(days=5)).isoformat() | |
| 336 | + }, | |
| 337 | + "deliveryLocation": { | |
| 338 | + "latitude": 49.8500, | |
| 339 | + "longitude": 24.0167 | |
| 340 | + }, | |
| 341 | + "deliveryAddress": { | |
| 342 | + "countryName": u"Україна", | |
| 343 | + "postalCode": "01008", | |
| 344 | + "region": u"м. Київ", | |
| 345 | + "locality": u"м. Київ", | |
| 346 | + "streetAddress": "ул. Грушевского, 12/2" | |
| 347 | + }, | |
| 348 | + "classification": { | |
| 349 | + "scheme": u"CPV", | |
| 350 | + "id": u"44617100-9", | |
| 351 | + "description": u"Cartons" | |
| 352 | + }, | |
| 353 | + "additionalClassifications": [ | |
| 354 | + { | |
| 355 | + "scheme": u"ДКПП", | |
| 356 | + "id": u"17.29.12-00.00", | |
| 357 | + "description": u"Блоки, плити та пластини фільтрувальні, з паперової маси" | |
| 358 | + } | |
| 359 | + ], | |
| 360 | + "unit": { | |
| 361 | + "name": u"кілограм", | |
| 362 | + "code": u"KGM" | |
| 363 | + }, | |
| 364 | + "quantity": fake.pyint() | |
| 365 | + }, | |
| 366 | + { | |
| 367 | + "description": fake.catch_phrase(), | |
| 368 | + "deliveryDate": { | |
| 369 | + "endDate": (now + timedelta(days=5)).isoformat() | |
| 370 | + }, | |
| 371 | + "deliveryLocation": { | |
| 372 | + "latitude": 49.8500, | |
| 373 | + "longitude": 24.0167 | |
| 374 | + }, | |
| 375 | + "deliveryAddress": { | |
| 376 | + "countryName": u"Україна", | |
| 377 | + "postalCode": fake.postalcode(), | |
| 378 | + "region": u"м. Київ", | |
| 379 | + "locality": u"м. Київ", | |
| 380 | + "streetAddress": fake.street_address() | |
| 381 | + }, | |
| 382 | + "classification": { | |
| 383 | + "scheme": u"CPV", | |
| 384 | + "id": u"44617100-9", | |
| 385 | + "description": u"Cartons" | |
| 386 | + }, | |
| 387 | + "additionalClassifications": [ | |
| 388 | + { | |
| 389 | + "scheme": u"ДКПП", | |
| 390 | + "id": u"17.21.99-00.00", | |
| 391 | + "description": u"Роботи субпідрядні як частина виробництва гофрованих паперу й картону, паперової та картонної тари" | |
| 392 | + } | |
| 393 | + ], | |
| 394 | + "unit": { | |
| 395 | + "name": u"кілограм", | |
| 396 | + "code": u"KGM" | |
| 397 | + }, | |
| 398 | + "quantity": fake.pyint() | |
| 399 | + }, | |
| 400 | + { | |
| 401 | + "description": fake.catch_phrase(), | |
| 402 | + "deliveryDate": { | |
| 403 | + "endDate": (now + timedelta(days=5)).isoformat() | |
| 404 | + }, | |
| 405 | + "deliveryLocation": { | |
| 406 | + "latitude": 49.3418, | |
| 407 | + "longitude": 39.1829 | |
| 408 | + }, | |
| 409 | + "deliveryAddress": { | |
| 410 | + "countryName": u"Україна", | |
| 411 | + "postalCode": fake.postalcode(), | |
| 412 | + "region": u"м. Луганськ", | |
| 413 | + "locality": u"м. Луганськ", | |
| 414 | + "streetAddress": "Вул. Оборонна 28" | |
| 415 | + }, | |
| 416 | + "classification": { | |
| 417 | + "scheme": u"CPV", | |
| 418 | + "id": u"44617100-9", | |
| 419 | + "description": u"Cartons" | |
| 420 | + }, | |
| 421 | + "additionalClassifications": [ | |
| 422 | + { | |
| 423 | + "scheme": u"ДКПП", | |
| 424 | + "id": u"17.22.12-40.00", | |
| 425 | + "description": u"Вата; вироби з вати, інші" | |
| 426 | + } | |
| 427 | + ], | |
| 428 | + "unit": { | |
| 429 | + "name": u"кілограм", | |
| 430 | + "code": u"KGM" | |
| 431 | + }, | |
| 432 | + "quantity": fake.pyint() | |
| 433 | + }, | |
| 434 | + { | |
| 435 | + "description": fake.catch_phrase(), | |
| 436 | + "deliveryDate": { | |
| 437 | + "endDate": (now + timedelta(days=5)).isoformat() | |
| 438 | + }, | |
| 439 | + "deliveryLocation": { | |
| 440 | + "latitude": 49.8500, | |
| 441 | + "longitude": 24.0167 | |
| 442 | + }, | |
| 443 | + "deliveryAddress": { | |
| 444 | + "countryName": u"Україна", | |
| 445 | + "postalCode": fake.postalcode(), | |
| 446 | + "region": u"м. Київ", | |
| 447 | + "locality": u"м. Київ", | |
| 448 | + "streetAddress": fake.street_address() | |
| 449 | + }, | |
| 450 | + "classification": { | |
| 451 | + "scheme": u"CPV", | |
| 452 | + "id": u"44617100-9", | |
| 453 | + "description": u"Cartons" | |
| 454 | + }, | |
| 455 | + "additionalClassifications": [ | |
| 456 | + { | |
| 457 | + "scheme": u"ДКПП", | |
| 458 | + "id": u"17.22.12-50.00", | |
| 459 | + "description": u"Одяг і речі до одягу з паперової маси, паперу, целюлозної вати чи полотна з целюлозного волокна (крім носових хусточок, наголовних уборів)" | |
| 460 | + } | |
| 461 | + ], | |
| 462 | + "unit": { | |
| 463 | + "name": u"кілограм", | |
| 464 | + "code": u"KGM" | |
| 465 | + }, | |
| 466 | + "quantity": fake.pyint() | |
| 467 | + } | |
| 468 | + ], | |
| 469 | + "enquiryPeriod": { | |
| 470 | + "endDate": (now + timedelta(minutes=120)).isoformat() | |
| 471 | + }, | |
| 472 | + "tenderPeriod": { | |
| 473 | + "endDate": (now + timedelta(minutes=120)).isoformat() | |
| 474 | + } | |
| 475 | +} | |
| 476 | + | |
| 208 | 477 | def test_question_data(): |
| 209 | 478 | return munchify({ |
| 210 | 479 | "data": { | ... | ... |
Please
register
or
login
to post a comment