Commit 9d1ef3788c91a76ef251b114d8373e2a35171629
1 parent
9ef33508
Make minimalStep.amount random value with limits in test_tender_data
Showing
1 changed file
with
4 additions
and
2 deletions
| @@ -4,6 +4,7 @@ from faker import Factory | @@ -4,6 +4,7 @@ from faker import Factory | ||
| 4 | from munch import munchify | 4 | from munch import munchify |
| 5 | from tempfile import NamedTemporaryFile | 5 | from tempfile import NamedTemporaryFile |
| 6 | from .local_time import get_now | 6 | from .local_time import get_now |
| 7 | +import random | ||
| 7 | 8 | ||
| 8 | fake = Factory.create('uk_UA') | 9 | fake = Factory.create('uk_UA') |
| 9 | fake_ru = Factory.create('ru') | 10 | fake_ru = Factory.create('ru') |
| @@ -29,6 +30,7 @@ def create_fake_doc(): | @@ -29,6 +30,7 @@ def create_fake_doc(): | ||
| 29 | 30 | ||
| 30 | def test_tender_data(intervals, periods=("enquiry", "tender")): | 31 | def test_tender_data(intervals, periods=("enquiry", "tender")): |
| 31 | now = get_now() | 32 | now = get_now() |
| 33 | + value_amount = 50000.99 | ||
| 32 | t_data = { | 34 | t_data = { |
| 33 | "title": u"[ТЕСТУВАННЯ] " + fake.catch_phrase(), | 35 | "title": u"[ТЕСТУВАННЯ] " + fake.catch_phrase(), |
| 34 | "mode": "test", | 36 | "mode": "test", |
| @@ -60,12 +62,12 @@ def test_tender_data(intervals, periods=("enquiry", "tender")): | @@ -60,12 +62,12 @@ def test_tender_data(intervals, periods=("enquiry", "tender")): | ||
| 60 | } | 62 | } |
| 61 | }, | 63 | }, |
| 62 | "value": { | 64 | "value": { |
| 63 | - "amount": 50000.99, | 65 | + "amount": value_amount, |
| 64 | "currency": u"UAH", | 66 | "currency": u"UAH", |
| 65 | "valueAddedTaxIncluded": True | 67 | "valueAddedTaxIncluded": True |
| 66 | }, | 68 | }, |
| 67 | "minimalStep": { | 69 | "minimalStep": { |
| 68 | - "amount": 100.1, | 70 | + "amount": round(random.uniform(0.005, 0.03) * value_amount, 2), |
| 69 | "currency": u"UAH" | 71 | "currency": u"UAH" |
| 70 | }, | 72 | }, |
| 71 | "items": [] | 73 | "items": [] |
Please
register
or
login
to post a comment