|
@@ -63,49 +63,10 @@ def test_tender_data(intervals, periods=("enquiry", "tender")): |
|
@@ -63,49 +63,10 @@ def test_tender_data(intervals, periods=("enquiry", "tender")): |
63
|
"amount": 100.1,
|
63
|
"amount": 100.1,
|
64
|
"currency": u"UAH"
|
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
|
period_dict = {}
|
70
|
period_dict = {}
|
110
|
inc_dt = now
|
71
|
inc_dt = now
|
111
|
for period_name in periods:
|
72
|
for period_name in periods:
|
|
@@ -211,24 +172,12 @@ def test_tender_data_multiple_lots(t_data): |
|
@@ -211,24 +172,12 @@ def test_tender_data_multiple_lots(t_data): |
211
|
for item in t_data['data']['items'][:-1]:
|
172
|
for item in t_data['data']['items'][:-1]:
|
212
|
item['relatedLot'] = first_lot_id
|
173
|
item['relatedLot'] = first_lot_id
|
213
|
t_data['data']['items'][-1]['relatedLot'] = second_lot_id
|
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
|
return t_data
|
181
|
return t_data
|
233
|
|
182
|
|
234
|
|
183
|
|
|
@@ -689,22 +638,21 @@ def test_invalid_features_data(): |
|
@@ -689,22 +638,21 @@ def test_invalid_features_data(): |
689
|
|
638
|
|
690
|
def test_lot_data():
|
639
|
def test_lot_data():
|
691
|
return munchify(
|
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
|
def test_lot_document_data(document, lot_id="3c8f387879de4c38957402dbdb8b31af"):
|
658
|
def test_lot_document_data(document, lot_id="3c8f387879de4c38957402dbdb8b31af"):
|