initial_data.py
4.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# -*- coding: utf-8 -
from datetime import datetime, timedelta
now = datetime.now()
from munch import munchify
from faker import Factory
fake = Factory.create('uk_UA')
fake_ru = Factory.create('ru')
fake_en = Factory.create()
test_tender_data = {
"title": fake.catch_phrase(),
"mode": "test",
"submissionMethodDetails": "quick",
"description": "Тестовий тендер",
"description_en": "Test tender",
"description_ru": "Тестовый тендер",
"procuringEntity": {
"name": fake.company(),
"name_ru": fake_ru.company(),
"name_en": fake_en.company(),
"identifier": {
"scheme": u"UA-EDR",
"id": u"0000{}".format(fake.pyint()),
"uri": fake.image_url(width=None, height=None)
},
"address": {
"countryName": u"Україна",
"postalCode": fake.postalcode(),
"region": u"м. Київ",
"locality": u"м. Київ",
"streetAddress": fake.street_address()
},
"contactPoint": {
"name": fake.name(),
"telephone": fake.phone_number()
}
},
"value": {
"amount": 50000,
"currency": u"UAH"
},
"minimalStep": {
"amount": 100,
"currency": u"UAH"
},
"items": [
{
"description": fake.catch_phrase(),
"classification": {
"scheme": u"CPV",
"id": u"44617100-9",
"description": u"Cartons"
},
"additionalClassifications": [
{
"scheme": u"ДКПП",
"id": u"17.21.1",
"description": u"папір і картон гофровані, паперова й картонна тара"
}
],
"unit": {
"name": u"item",
"code": u"44617100-9"
},
"quantity": fake.pyint()
}
],
"enquiryPeriod": {
"endDate": (now + timedelta(days=1)).isoformat()
},
"tenderPeriod": {
"endDate": (now + timedelta(days=2)).isoformat()
}
}
def test_question_data():
return {
"data": {
"author": {
"address": {
"countryName": "Україна",
"locality": "м. Вінниця",
"postalCode": "21100",
"region": "м. Вінниця",
"streetAddress": fake.street_address()
},
"contactPoint": {
"name": fake.name(),
"telephone": fake.phone_number()
},
"identifier": {
"scheme": u"UA-EDR",
"id": u"0000{}".format(fake.pyint()),
"uri": fake.image_url(width=None, height=None)
},
"name": fake.company()
},
"description": fake.sentence(nb_words=10, variable_nb_words=True),
"title": fake.sentence(nb_words=6, variable_nb_words=True)
}
}
def test_question_answer_data():
return {
"data": {
"answer": fake.sentence(nb_words=40, variable_nb_words=True)
}
}
def test_bid_data():
return munchify({
"data": {
"tenderers": [
{
"address": {
"countryName": "Україна",
"locality": "м. Вінниця",
"postalCode": "21100",
"region": "м. Вінниця",
"streetAddress": fake.street_address()
},
"contactPoint": {
"name": fake.name(),
"telephone": fake.phone_number()
},
"identifier": {
"scheme": u"UA-EDR",
"id": u"0000{}".format(fake.pyint()),
},
"name": fake.company()
}
],
"value": {
"amount": 500
}
}
})