Commit b29c5ad914fad903d02023b1f20626d475166c98
Merge pull request #101 from Leits/init_data
Update initial data
Showing
3 changed files
with
30 additions
and
78 deletions
... | ... | @@ -63,49 +63,10 @@ def test_tender_data(intervals, periods=("enquiry", "tender")): |
63 | 63 | "amount": 100.1, |
64 | 64 | "currency": u"UAH" |
65 | 65 | }, |
66 | - "items": [ | |
67 | - { | |
68 | - "description": fake.catch_phrase(), | |
69 | - "deliveryDate": { | |
70 | - "endDate": (now + timedelta(days=5)).isoformat() | |
71 | - }, | |
72 | - "deliveryLocation": { | |
73 | - "latitude": 49.8500, | |
74 | - "longitude": 24.0167 | |
75 | - }, | |
76 | - "deliveryAddress": { | |
77 | - "countryName": u"Україна", | |
78 | - "countryName_ru": u"Украина", | |
79 | - "countryName_en": "Ukraine", | |
80 | - "postalCode": fake.postalcode(), | |
81 | - "region": u"м. Київ", | |
82 | - "locality": u"м. Київ", | |
83 | - "streetAddress": fake.street_address() | |
84 | - }, | |
85 | - "classification": { | |
86 | - "scheme": u"CPV", | |
87 | - "id": u"44617100-9", | |
88 | - "description": u"Картонки", | |
89 | - "description_ru": u"Большие картонные коробки", | |
90 | - "description_en": u"Cartons" | |
91 | - }, | |
92 | - "additionalClassifications": [ | |
93 | - { | |
94 | - "scheme": u"ДКПП", | |
95 | - "id": u"17.21.1", | |
96 | - "description": u"Папір і картон гофровані, паперова й картонна тара" | |
97 | - } | |
98 | - ], | |
99 | - "unit": { | |
100 | - "name": u"кілограм", | |
101 | - "name_ru": u"килограмм", | |
102 | - "name_en": "kilogram", | |
103 | - "code": u"KGM" | |
104 | - }, | |
105 | - "quantity": fake.pyint() | |
106 | - } | |
107 | - ] | |
66 | + "items": [] | |
108 | 67 | } |
68 | + new_item = test_item_data() | |
69 | + t_data['items'].append(new_item) | |
109 | 70 | period_dict = {} |
110 | 71 | inc_dt = now |
111 | 72 | for period_name in periods: |
... | ... | @@ -211,24 +172,12 @@ def test_tender_data_multiple_lots(t_data): |
211 | 172 | for item in t_data['data']['items'][:-1]: |
212 | 173 | item['relatedLot'] = first_lot_id |
213 | 174 | t_data['data']['items'][-1]['relatedLot'] = second_lot_id |
214 | - | |
215 | - t_data['data']['lots'] = [ | |
216 | - { | |
217 | - "id": first_lot_id, | |
218 | - "title": "Lot #1: Kyiv stationery", | |
219 | - "description": "Items for Kyiv office", | |
220 | - "value": {"currency": "UAH", "amount": 34000.0, "valueAddedTaxIncluded": "true"}, | |
221 | - "minimalStep": {"currency": "UAH", "amount": 30.0, "valueAddedTaxIncluded": "true"}, | |
222 | - "status": "active" | |
223 | - }, { | |
224 | - "id": second_lot_id, | |
225 | - "title": "Lot #2: Lviv stationery", | |
226 | - "description": "Items for Lviv office", | |
227 | - "value": {"currency": "UAH", "amount": 9000.0, "valueAddedTaxIncluded": "true"}, | |
228 | - "minimalStep": {"currency": "UAH", "amount": 35.0, "valueAddedTaxIncluded": "true"}, | |
229 | - "status": "active" | |
230 | - } | |
231 | - ] | |
175 | + t_data['data']['lots'] = [] | |
176 | + for _ in range(2): | |
177 | + new_lot = test_lot_data() | |
178 | + t_data['data']['lots'].append(new_lot) | |
179 | + t_data['data']['lots'][0]['id'] = first_lot_id | |
180 | + t_data['data']['lots'][1]['id'] = second_lot_id | |
232 | 181 | return t_data |
233 | 182 | |
234 | 183 | |
... | ... | @@ -689,22 +638,21 @@ def test_invalid_features_data(): |
689 | 638 | |
690 | 639 | def test_lot_data(): |
691 | 640 | return munchify( |
692 | - {'data': | |
693 | - { | |
694 | - "description": fake.sentence(nb_words=10, variable_nb_words=True), | |
695 | - "title": fake.sentence(nb_words=6, variable_nb_words=True), | |
696 | - "value": { | |
697 | - "currency": "UAH", | |
698 | - "amount": fake.pyfloat(left_digits=4, right_digits=1, positive=True), | |
699 | - "valueAddedTaxIncluded": "true" | |
700 | - }, | |
701 | - "minimalStep": { | |
702 | - "currency": "UAH", | |
703 | - "amount": 30.0, | |
704 | - "valueAddedTaxIncluded": "true" | |
705 | - }, | |
706 | - "status": "active" | |
707 | - }}) | |
641 | + { | |
642 | + "description": fake.sentence(nb_words=10, variable_nb_words=True), | |
643 | + "title": fake.sentence(nb_words=6, variable_nb_words=True), | |
644 | + "value": { | |
645 | + "currency": "UAH", | |
646 | + "amount": 2000 + fake.pyfloat(left_digits=4, right_digits=1, positive=True), | |
647 | + "valueAddedTaxIncluded": "true" | |
648 | + }, | |
649 | + "minimalStep": { | |
650 | + "currency": "UAH", | |
651 | + "amount": 30.0, | |
652 | + "valueAddedTaxIncluded": "true" | |
653 | + }, | |
654 | + "status": "active" | |
655 | + }) | |
708 | 656 | |
709 | 657 | |
710 | 658 | def test_lot_document_data(document, lot_id="3c8f387879de4c38957402dbdb8b31af"): | ... | ... |
... | ... | @@ -135,6 +135,10 @@ Get Broker Property By Username |
135 | 135 | Log ${tender_data} |
136 | 136 | [return] ${tender_data} |
137 | 137 | |
138 | +Підготовка даних для створення лоту | |
139 | + ${lot}= test_lot_data | |
140 | + ${reply}= Create Dictionary data=${lot} | |
141 | + [Return] ${reply} | |
138 | 142 | |
139 | 143 | Підготовка даних для подання вимоги |
140 | 144 | ${claim}= test_claim_data | ... | ... |
... | ... | @@ -52,7 +52,7 @@ ${complaint_id} 1 |
52 | 52 | [Setup] Дочекатись синхронізації з майданчиком ${tender_owner} |
53 | 53 | [Teardown] Оновити LAST_MODIFICATION_DATE |
54 | 54 | ${tender_data}= Get Variable Value ${USERS.users['${tender_owner}'].tender_data} |
55 | - ${lot}= test lot data | |
55 | + ${lot}= Підготовка даних для створення лоту | |
56 | 56 | ${lotcreate}= Викликати для учасника ${tender_owner} Створити лот ${tender_data} ${lot} |
57 | 57 | ${lotresponses}= Create Dictionary |
58 | 58 | Set To Dictionary ${lotresponses} resp0 ${lotcreate} |
... | ... | @@ -75,7 +75,7 @@ ${complaint_id} 1 |
75 | 75 | ... ${USERS.users['${tender_owner}'].broker} |
76 | 76 | [Teardown] Оновити LAST_MODIFICATION_DATE |
77 | 77 | ${tender_data}= Get Variable Value ${USERS.users['${tender_owner}'].tender_data} |
78 | - ${lot}= test lot data | |
78 | + ${lot}= Підготовка даних для створення лоту | |
79 | 79 | ${lotcreate}= Викликати для учасника ${tender_owner} Створити лот ${tender_data} ${lot} |
80 | 80 | ${lotresponses}= Create Dictionary |
81 | 81 | Set To Dictionary ${lotresponses} resp ${lotcreate} | ... | ... |
Please
register
or
login
to post a comment