Commit ccb9ae2dff4744eb09f64cd813b60163bf52811d

Authored by selurvedu
2 parents d365fb30 574d5053

Merge pull request #99 from Leits/id

Descriptions with id

Ref: #62

Conflicts:
	op_robot_tests/tests_files/initial_data.py
... ... @@ -14,6 +14,10 @@ def create_fake_sentence():
14 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 21 def create_fake_doc():
18 22 content = fake.text()
19 23 suffix = fake.random_element(('.txt', '.doc', '.docx', '.pdf'))
... ... @@ -99,7 +103,7 @@ def test_tender_data_limited(intervals, procurement_method_type):
99 103 "id": "55523100-3",
100 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 107 "id": "2dc54675d6364e2baffbc0f8e74432ac",
104 108 "deliveryDate": {
105 109 "endDate": (now + timedelta(days=5)).isoformat()
... ... @@ -214,7 +218,7 @@ def test_meat_tender_data(tender):
214 218 "code": "ee3e24bc17234a41bd3e3a04cc28e9c6",
215 219 "featureOf": "tenderer",
216 220 "title": "Термін оплати",
217   - "description": "Умови відстрочки платежу після поставки товару",
  221 + "description": description_with_id('f', "Умови відстрочки платежу після поставки товару"),
218 222 "enum": [
219 223 {
220 224 "value": 0.15,
... ... @@ -239,7 +243,7 @@ def test_meat_tender_data(tender):
239 243 "featureOf": "item",
240 244 "relatedItem": item_id,
241 245 "title": "Сорт",
242   - "description": "Сорт продукції",
  246 + "description": description_with_id('f', "Сорт продукції"),
243 247 "enum": [
244 248 {
245 249 "value": 0.05,
... ... @@ -283,7 +287,7 @@ def test_question_data(lot=False):
283 287 },
284 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 291 "title": fake.sentence(nb_words=6, variable_nb_words=True)
288 292 }
289 293 })
... ... @@ -582,7 +586,7 @@ def test_award_data():
582 586 def test_item_data():
583 587 now = get_now()
584 588 return {
585   - "description": fake.catch_phrase(),
  589 + "description": description_with_id('i', fake.catch_phrase()),
586 590 "deliveryDate": {
587 591 "endDate": (now + timedelta(days=5)).isoformat()
588 592 },
... ... @@ -664,7 +668,7 @@ def test_invalid_features_data():
664 668 def test_lot_data():
665 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 672 "title": fake.sentence(nb_words=6, variable_nb_words=True),
669 673 "value": {
670 674 "currency": "UAH",
... ...
Please register or login to post a comment