Commit ccb9ae2dff4744eb09f64cd813b60163bf52811d
Merge pull request #99 from Leits/id
Descriptions with id Ref: #62 Conflicts: op_robot_tests/tests_files/initial_data.py
Showing
1 changed file
with
10 additions
and
6 deletions
| @@ -14,6 +14,10 @@ def create_fake_sentence(): | @@ -14,6 +14,10 @@ def create_fake_sentence(): | ||
| 14 | return fake.sentence(nb_words=10, variable_nb_words=True) | 14 | return fake.sentence(nb_words=10, variable_nb_words=True) |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | +def description_with_id(prefix, sentence): | ||
| 18 | + return "{}-{}: {}".format(prefix, fake.uuid4()[:8], sentence) | ||
| 19 | + | ||
| 20 | + | ||
| 17 | def create_fake_doc(): | 21 | def create_fake_doc(): |
| 18 | content = fake.text() | 22 | content = fake.text() |
| 19 | suffix = fake.random_element(('.txt', '.doc', '.docx', '.pdf')) | 23 | suffix = fake.random_element(('.txt', '.doc', '.docx', '.pdf')) |
| @@ -99,7 +103,7 @@ def test_tender_data_limited(intervals, procurement_method_type): | @@ -99,7 +103,7 @@ def test_tender_data_limited(intervals, procurement_method_type): | ||
| 99 | "id": "55523100-3", | 103 | "id": "55523100-3", |
| 100 | "scheme": "CPV" | 104 | "scheme": "CPV" |
| 101 | }, | 105 | }, |
| 102 | - "description": fake.sentence(nb_words=10, variable_nb_words=True), | 106 | + "description": description_with_id('i', fake.sentence(nb_words=10, variable_nb_words=True)), |
| 103 | "id": "2dc54675d6364e2baffbc0f8e74432ac", | 107 | "id": "2dc54675d6364e2baffbc0f8e74432ac", |
| 104 | "deliveryDate": { | 108 | "deliveryDate": { |
| 105 | "endDate": (now + timedelta(days=5)).isoformat() | 109 | "endDate": (now + timedelta(days=5)).isoformat() |
| @@ -214,7 +218,7 @@ def test_meat_tender_data(tender): | @@ -214,7 +218,7 @@ def test_meat_tender_data(tender): | ||
| 214 | "code": "ee3e24bc17234a41bd3e3a04cc28e9c6", | 218 | "code": "ee3e24bc17234a41bd3e3a04cc28e9c6", |
| 215 | "featureOf": "tenderer", | 219 | "featureOf": "tenderer", |
| 216 | "title": "Термін оплати", | 220 | "title": "Термін оплати", |
| 217 | - "description": "Умови відстрочки платежу після поставки товару", | 221 | + "description": description_with_id('f', "Умови відстрочки платежу після поставки товару"), |
| 218 | "enum": [ | 222 | "enum": [ |
| 219 | { | 223 | { |
| 220 | "value": 0.15, | 224 | "value": 0.15, |
| @@ -239,7 +243,7 @@ def test_meat_tender_data(tender): | @@ -239,7 +243,7 @@ def test_meat_tender_data(tender): | ||
| 239 | "featureOf": "item", | 243 | "featureOf": "item", |
| 240 | "relatedItem": item_id, | 244 | "relatedItem": item_id, |
| 241 | "title": "Сорт", | 245 | "title": "Сорт", |
| 242 | - "description": "Сорт продукції", | 246 | + "description": description_with_id('f', "Сорт продукції"), |
| 243 | "enum": [ | 247 | "enum": [ |
| 244 | { | 248 | { |
| 245 | "value": 0.05, | 249 | "value": 0.05, |
| @@ -283,7 +287,7 @@ def test_question_data(lot=False): | @@ -283,7 +287,7 @@ def test_question_data(lot=False): | ||
| 283 | }, | 287 | }, |
| 284 | "name": fake.company() | 288 | "name": fake.company() |
| 285 | }, | 289 | }, |
| 286 | - "description": fake.sentence(nb_words=10, variable_nb_words=True), | 290 | + "description": description_with_id('q', fake.sentence(nb_words=10, variable_nb_words=True)), |
| 287 | "title": fake.sentence(nb_words=6, variable_nb_words=True) | 291 | "title": fake.sentence(nb_words=6, variable_nb_words=True) |
| 288 | } | 292 | } |
| 289 | }) | 293 | }) |
| @@ -582,7 +586,7 @@ def test_award_data(): | @@ -582,7 +586,7 @@ def test_award_data(): | ||
| 582 | def test_item_data(): | 586 | def test_item_data(): |
| 583 | now = get_now() | 587 | now = get_now() |
| 584 | return { | 588 | return { |
| 585 | - "description": fake.catch_phrase(), | 589 | + "description": description_with_id('i', fake.catch_phrase()), |
| 586 | "deliveryDate": { | 590 | "deliveryDate": { |
| 587 | "endDate": (now + timedelta(days=5)).isoformat() | 591 | "endDate": (now + timedelta(days=5)).isoformat() |
| 588 | }, | 592 | }, |
| @@ -664,7 +668,7 @@ def test_invalid_features_data(): | @@ -664,7 +668,7 @@ def test_invalid_features_data(): | ||
| 664 | def test_lot_data(): | 668 | def test_lot_data(): |
| 665 | return munchify( | 669 | return munchify( |
| 666 | { | 670 | { |
| 667 | - "description": fake.sentence(nb_words=10, variable_nb_words=True), | 671 | + "description": description_with_id('l', fake.sentence(nb_words=10, variable_nb_words=True)), |
| 668 | "title": fake.sentence(nb_words=6, variable_nb_words=True), | 672 | "title": fake.sentence(nb_words=6, variable_nb_words=True), |
| 669 | "value": { | 673 | "value": { |
| 670 | "currency": "UAH", | 674 | "currency": "UAH", |
Please
register
or
login
to post a comment