Commit 41f211563253faff629b1c2a8849b50c081647b7

Authored by alexdiatlov
Committed by GitHub
2 parents e15792cb 4d9d3464

Merge pull request #96 from ProzorroUKR/float_quantity

quantity_float
@@ -52,6 +52,10 @@ def create_fake_number(min_number, max_number): @@ -52,6 +52,10 @@ def create_fake_number(min_number, max_number):
52 return random.randint(int(min_number), int(max_number)) 52 return random.randint(int(min_number), int(max_number))
53 53
54 54
  55 +def create_fake_number_float(min_number, max_number):
  56 + return round(random.uniform(float(min_number), float(max_number)), 3)
  57 +
  58 +
55 def create_fake_title(): 59 def create_fake_title():
56 return u"[ТЕСТУВАННЯ] {}".format(fake.title()) 60 return u"[ТЕСТУВАННЯ] {}".format(fake.title())
57 61
@@ -162,7 +162,7 @@ class OP_Provider(BaseProvider): @@ -162,7 +162,7 @@ class OP_Provider(BaseProvider):
162 "deliveryAddress": address["deliveryAddress"], 162 "deliveryAddress": address["deliveryAddress"],
163 "deliveryLocation": address["deliveryLocation"], 163 "deliveryLocation": address["deliveryLocation"],
164 "unit": item_base_data["unit"], 164 "unit": item_base_data["unit"],
165 - "quantity": self.randomize_nb_elements(number=item_base_data["quantity"], le=80, ge=120) 165 + "quantity": round(random.uniform(3, 150), 3)
166 } 166 }
167 if item_base_data["cpv_id"] == "99999999-9": 167 if item_base_data["cpv_id"] == "99999999-9":
168 scheme = classification["additionalClassifications"][0]["scheme"] 168 scheme = classification["additionalClassifications"][0]["scheme"]
@@ -93,7 +93,7 @@ ${MOZ_INTEGRATION} ${False} @@ -93,7 +93,7 @@ ${MOZ_INTEGRATION} ${False}
93 ... critical 93 ... critical
94 [Setup] Дочекатись синхронізації з майданчиком ${tender_owner} 94 [Setup] Дочекатись синхронізації з майданчиком ${tender_owner}
95 [Teardown] Оновити LAST_MODIFICATION_DATE 95 [Teardown] Оновити LAST_MODIFICATION_DATE
96 - ${new_quantity}= create_fake_number ${1} ${USERS.users['${tender_owner}'].tender_data.data['items'][0]['quantity']} 96 + ${new_quantity}= create_fake_number_float ${1} ${USERS.users['${tender_owner}'].tender_data.data['items'][0]['quantity']}
97 Можливість змінити поле items[0].quantity тендера на ${new_quantity} 97 Можливість змінити поле items[0].quantity тендера на ${new_quantity}
98 98
99 99
@@ -21,6 +21,7 @@ from .initial_data import ( @@ -21,6 +21,7 @@ from .initial_data import (
21 create_fake_sentence, 21 create_fake_sentence,
22 create_fake_amount, 22 create_fake_amount,
23 create_fake_number, 23 create_fake_number,
  24 + create_fake_number_float,
24 create_fake_date, 25 create_fake_date,
25 create_fake_funder, 26 create_fake_funder,
26 create_fake_period, 27 create_fake_period,
Please register or login to post a comment