Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/a226483501826784_a16881127411685…
Browse files Browse the repository at this point in the history
…0_submit_bid_with_documents'
  • Loading branch information
vmaksymiv committed Dec 28, 2016
2 parents b01f6c5 + 2566a50 commit 6ea3d90
Show file tree
Hide file tree
Showing 14 changed files with 475 additions and 146 deletions.
95 changes: 91 additions & 4 deletions docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,63 @@
}
}

bid2_with_docs = deepcopy(bid2)

bid2_with_docs["data"]["documents"] = [
{
'title': u'Proposal_part1.pdf',
'url': u"http://broken1.ds",
'hash': 'md5:' + '0' * 32,
'format': 'application/pdf',
}
]

bid4_with_docs = deepcopy(bid4)

bid4_with_docs["data"]["documents"] = [
{
'title': u'Proposal_part1.pdf',
'url': u"http://broken1.ds",
'hash': 'md5:' + '0' * 32,
'format': 'application/pdf',
},
{
'title': u'Proposal_part2.pdf',
'url': u"http://broken2.ds",
'hash': 'md5:' + '0' * 32,
'format': 'application/pdf',
'confidentiality': 'buyerOnly',
'confidentialityRationale': 'Only our company sells badgers with pink hair.',
}
]

bid4_with_docs["data"]["eligibilityDocuments"] = [
{
'title': u'eligibility_doc.pdf',
'url': u"http://broken3.ds",
'hash': 'md5:' + '0' * 32,
'format': 'application/pdf'
}
]

bid4_with_docs["data"]["financialDocuments"] = [
{
'title': u'financial_doc.pdf',
'url': u"http://broken4.ds",
'hash': 'md5:' + '0' * 32,
'format': 'application/pdf'
}
]

bid4_with_docs["data"]["qualificationDocuments"] = [
{
'title': u'qualification_document.pdf',
'url': u"http://broken5.ds",
'hash': 'md5:' + '0' * 32,
'format': 'application/pdf'
}
]

question = {
"data": {
"author": {
Expand Down Expand Up @@ -800,13 +857,22 @@ def do_request(self, req, status=None, expect_errors=None):

class TenderResourceTest(BaseCompetitiveDialogEUWebTest):
initial_data = test_tender_data_stage1
docservice = True

def setUp(self):
self.app = DumpsTestAppwebtest("config:tests.ini", relative_to=os.path.dirname(base_test.__file__))
self.app.RequestClass = PrefixedRequestClass
self.app.authorization = ('Basic', ('broker', ''))
self.couchdb_server = self.app.app.registry.couchdb_server
self.db = self.app.app.registry.db
if self.docservice:
self.setUpDS()
self.app.app.registry.docservice_url = 'http://public.docs-sandbox.openprocurement.org'

def generate_docservice_url(self):
return super(TenderResourceTest, self).generate_docservice_url().replace(
'/localhost/', '/public.docs-sandbox.openprocurement.org/'
)

def test_stage1(self):
request_path = '/tenders?opt_pretty=1'
Expand Down Expand Up @@ -1076,7 +1142,9 @@ def test_stage1(self):
self.assertEqual(response.status, '201 Created')

with open('docs/source/tutorial/register-4rd-bidder.http', 'w') as self.app.file_obj:
response = self.app.post_json('/tenders/{}/bids'.format(self.tender_id), bid4)
for document in bid4_with_docs['data']['documents']:
document['url'] = self.generate_docservice_url()
response = self.app.post_json('/tenders/{}/bids'.format(self.tender_id), bid4_with_docs)
bid4_id = response.json['data']['id']
bids_access[bid4_id] = response.json['access']['token']
self.assertEqual(response.status, '201 Created')
Expand Down Expand Up @@ -1432,7 +1500,15 @@ def test_stage2_EU(self):
self.assertEqual(response.status, '201 Created')

with open('docs/source/tutorial/stage2/EU/register-3rd-bidder.http', 'w') as self.app.file_obj:
response = self.app.post_json('/tenders/{}/bids'.format(self.tender_id), bid4)
for document in bid4_with_docs['data']['documents']:
document['url'] = self.generate_docservice_url()
for document in bid4_with_docs['data']['eligibilityDocuments']:
document['url'] = self.generate_docservice_url()
for document in bid4_with_docs['data']['financialDocuments']:
document['url'] = self.generate_docservice_url()
for document in bid4_with_docs['data']['qualificationDocuments']:
document['url'] = self.generate_docservice_url()
response = self.app.post_json('/tenders/{}/bids'.format(self.tender_id), bid4_with_docs)
bid3_id = response.json['data']['id']
bids_access[bid3_id] = response.json['access']['token']
self.assertEqual(response.status, '201 Created')
Expand Down Expand Up @@ -2563,7 +2639,7 @@ def test_award_complaints_stage2(self):


class TenderResourceTestStage2UA(BaseCompetitiveDialogUAStage2WebTest):

docservice = True
initial_data = test_tender_data_stage1

def setUp(self):
Expand All @@ -2573,6 +2649,15 @@ def setUp(self):
self.couchdb_server = self.app.app.registry.couchdb_server
self.db = self.app.app.registry.db

if self.docservice:
self.setUpDS()
self.app.app.registry.docservice_url = 'http://public.docs-sandbox.openprocurement.org'

def generate_docservice_url(self):
return super(TenderResourceTestStage2UA,self).generate_docservice_url().replace(
'/localhost/', '/public.docs-sandbox.openprocurement.org/'
)

def test_stage2_UA(self):
request_path = '/tenders?opt_pretty=1'

Expand Down Expand Up @@ -2752,7 +2837,9 @@ def test_stage2_UA(self):
self.assertEqual(response.status, '200 OK')

with open('docs/source/tutorial/stage2/UA/register-2nd-bidder.http', 'w') as self.app.file_obj:
response = self.app.post_json('/tenders/{}/bids'.format(self.tender_id), bid2)
for document in bid2_with_docs['data']['documents']:
document['url'] = self.generate_docservice_url()
response = self.app.post_json('/tenders/{}/bids'.format(self.tender_id), bid2_with_docs)
bid2_id = response.json['data']['id']
bids_access[bid2_id] = response.json['access']['token']
self.assertEqual(response.status, '201 Created')
Expand Down
Binary file added docs/source/locale/uk/LC_MESSAGES/tutorial.mo
Binary file not shown.
89 changes: 50 additions & 39 deletions docs/source/locale/uk/LC_MESSAGES/tutorial.po
Original file line number Diff line number Diff line change
Expand Up @@ -372,128 +372,128 @@ msgstr "Учасник повинен підтвердити свою пропо
msgid "Register two more bid:"
msgstr "Зареєструемо ще дві пропозиції:"

#: ../../source/tutorial.rst:282
#: ../../source/tutorial.rst:287
msgid "Bid Qualification"
msgstr "Кваліфікація пропозицій"

#: ../../source/tutorial.rst:284
#: ../../source/tutorial.rst:289
msgid "Competitive Dialogue procedure requires bid qualification."
msgstr ""
"Для першого етапу конкурентного діалогу необхідна кваліфікація пропозицій."

#: ../../source/tutorial.rst:286
#: ../../source/tutorial.rst:291
msgid "Let's list qualifications:"
msgstr "Переглянемо список кваліфікацій:"

#: ../../source/tutorial.rst:292
#: ../../source/tutorial.rst:297
msgid "Approve first three bids through qualification objects:"
msgstr "Підтвердіть перші три пропозиції через кваліфікаційні об’єкти:"

#: ../../source/tutorial.rst:303
#: ../../source/tutorial.rst:308
msgid "We can also reject bid:"
msgstr "Можна відхилити пропозицію:"

#: ../../source/tutorial.rst:308
#: ../../source/tutorial.rst:313
msgid "And check that qualified bids are switched to `active`:"
msgstr ""
"Та перевірити, що вже кваліфіковані пропозиції переключені в стан `active`:"

#: ../../source/tutorial.rst:313
#: ../../source/tutorial.rst:318
msgid "Rejected bid is not shown in `bids/` listing."
msgstr "Відхилена пропозиція не присутня в списку `bids/`."

#: ../../source/tutorial.rst:315
#: ../../source/tutorial.rst:320
msgid "We can access rejected bid by id:"
msgstr ""
"Можна отримати доступ до відхиленої пропозиції за її ідентифікатором `id`:"

#: ../../source/tutorial.rst:320
#: ../../source/tutorial.rst:325
msgid "Procuring entity approves qualifications by switching to next status:"
msgstr "Замовник підтверджує кваліфікацію переходом до наступного статусу:"

#: ../../source/tutorial.rst:325
#: ../../source/tutorial.rst:330
msgid "You may notice 10 day stand-still time set in `qualificationPeriod`."
msgstr ""
"Зверніть увагу на період блокування в 10 днів під час `qualificationPeriod`."

#: ../../source/tutorial.rst:329
#: ../../source/tutorial.rst:334
msgid "Ready to stage2"
msgstr "Готовність до другог етапу"

#: ../../source/tutorial.rst:331
#: ../../source/tutorial.rst:336
msgid ""
"When qualification period end tender will has status active.stage2.pending"
msgstr ""
"Коли ``qualificationPeriod`` період завершиться тендер змінить статус на "
"``active.stage2.pending``"

#: ../../source/tutorial.rst:333
#: ../../source/tutorial.rst:338
msgid "Lets look on your tender"
msgstr "Подивимося на наш тендер"

#: ../../source/tutorial.rst:346
#: ../../source/tutorial.rst:351
msgid "Get token for second stage"
msgstr "Отримаємо токен для другого етапу"

#: ../../source/tutorial.rst:348
#: ../../source/tutorial.rst:353
msgid "When tender status is ``complete``, we can get id new stage."
msgstr ""
"Коли статус тендеру(першого етапу) буду ``complete``, ми можемо отримати id "
"другого етапу."

#: ../../source/tutorial.rst:350
#: ../../source/tutorial.rst:355
msgid "First lets look on tender and find field ``stage2TenderID``"
msgstr "Подивимось на тендер і знайдемо поле ``stage2TenderID``"

#: ../../source/tutorial.rst:356
#: ../../source/tutorial.rst:361
msgid "Form making changes in second stage we need token"
msgstr "Щоб робити зміни в другому етапі потрібно отримати токен."

#: ../../source/tutorial.rst:362
#: ../../source/tutorial.rst:367
msgid "Make changes second stage"
msgstr "Зробимо зміни на другому етапі"

#: ../../source/tutorial.rst:364
#: ../../source/tutorial.rst:369
msgid ""
"Good, now we get token, and can make changes, so lets change status from "
"``draft.stage2`` to ``active.tendering``"
msgstr ""
"Добре, ми отримали токен, і можемо робити зміни в другому етапі. Спробуемо "
"змінити статус ``draft.stage2`` на ``active.tendering``."

#: ../../source/tutorial.rst:371
#: ../../source/tutorial.rst:376
msgid "Stage2 EU"
msgstr "Другий етап EU"

#: ../../source/tutorial.rst:379
#: ../../source/tutorial.rst:384
msgid "Stage2 UA"
msgstr "Другий етап UA"

#: ../../source/tutorial.rst:388
#: ../../source/tutorial.rst:393
msgid "Cancelling tender"
msgstr "Скасування закупівлі"

#: ../../source/tutorial.rst:390
#: ../../source/tutorial.rst:395
msgid ""
"Tender creator can cancel tender anytime. The following steps should be "
"applied:"
msgstr ""
"Замовник може скасувати закупівлю у будь-який момент. Для цього виконайте "
"наступні кроки:"

#: ../../source/tutorial.rst:392
#: ../../source/tutorial.rst:397
msgid "Prepare cancellation request."
msgstr "Приготуйте запит на скасування."

#: ../../source/tutorial.rst:393
#: ../../source/tutorial.rst:398
msgid "Fill it with the protocol describing the cancellation reasons."
msgstr "Наповніть його протоколом про причини скасування."

#: ../../source/tutorial.rst:394
#: ../../source/tutorial.rst:399
msgid "Cancel the tender with the prepared reasons."
msgstr "Скасуйте закупівлю через подані причини."

#: ../../source/tutorial.rst:396
#: ../../source/tutorial.rst:401
msgid ""
"Only the request that has been activated (3rd step above) has power to "
"cancel tender. I.e. you have to not only prepare cancellation request but "
Expand All @@ -503,27 +503,27 @@ msgstr ""
"тобто, для скасування закупівлі буде обов’язковим не тільки створити заявку,"
" але і активувати її."

#: ../../source/tutorial.rst:400
#: ../../source/tutorial.rst:405
msgid "See :ref:`cancellation` data structure for details."
msgstr ""
"Дивіться структуру запиту :ref:`cancellation` для більш детальної "
"інформації."

#: ../../source/tutorial.rst:403
#: ../../source/tutorial.rst:408
msgid "Preparing the cancellation request"
msgstr "Формування запиту на скасування"

#: ../../source/tutorial.rst:405
#: ../../source/tutorial.rst:410
msgid "You should pass `reason`, `status` defaults to `pending`."
msgstr "Ви повинні передати змінні `reason`, `status` у стані `pending`."

#: ../../source/tutorial.rst:407
#: ../../source/tutorial.rst:412
msgid "`id` is autogenerated and passed in the `Location` header of response."
msgstr ""
"`id` генерується автоматично і повертається у додатковому заголовку "
"відповіді `Location`:"

#: ../../source/tutorial.rst:412
#: ../../source/tutorial.rst:417
msgid ""
"There are two possible types of cancellation reason: tender was `cancelled` "
"or `unsuccessful`. By default ``reasonType`` value is `cancelled`."
Expand All @@ -532,27 +532,27 @@ msgstr ""
"торги відмінені - `cancelled`, або торги не відбулися - `unsuccessful`. За "
"замовчуванням, значення ``reasonType`` рівне `cancelled`."

#: ../../source/tutorial.rst:414
#: ../../source/tutorial.rst:419
msgid "You can change ``reasonType`` value to `unsuccessful`."
msgstr "Ви можете виправити тип на `unsuccessful` (торги не відбулися)."

#: ../../source/tutorial.rst:420
#: ../../source/tutorial.rst:425
msgid "Filling cancellation with protocol and supplementary documentation"
msgstr "Наповнення протоколом та іншою супровідною документацією"

#: ../../source/tutorial.rst:422
#: ../../source/tutorial.rst:427
msgid "Upload the file contents"
msgstr "Завантажте вміст файлу"

#: ../../source/tutorial.rst:427
#: ../../source/tutorial.rst:432
msgid "Change the document description and other properties"
msgstr "Змініть опис документа та інші властивості"

#: ../../source/tutorial.rst:433
#: ../../source/tutorial.rst:438
msgid "Upload new version of the document"
msgstr "Завантажте нову версію документа"

#: ../../source/tutorial.rst:440
#: ../../source/tutorial.rst:445
msgid "Activating the request and cancelling tender"
msgstr "Активація запиту та скасування закупівлі"

Expand All @@ -572,10 +572,21 @@ msgstr ""
"Для процедури конкурентного діалогу першого етапу потрібно хоча б 3 "
"пропозиції:"

#: ../../source/tutorial.rst:339
#: ../../source/tutorial.rst:344
msgid ""
"Hoт purchasing can set that he is ready for second stage, by setting status "
"to ``active.stage2.waiting``."
msgstr ""
"Замовник може підтвердити свою готовність переходити на другий етап, "
"змінивши стаус тендера на ``active.stage2.waiting``"

#: ../../source/tutorial.rst:276
msgid "Batch-mode bid registration"
msgstr "Пакетний режим реєстрації"

#: ../../source/tutorial.rst:278
msgid ""
"Register one more bid with documents using single request (batch-mode):"
msgstr ""
"У пакетному режимі (batch-mode) є можливість зареєструвати пропозицію одним "
"запитом. Зареєструйте ще одну пропозицію:"
Binary file not shown.

0 comments on commit 6ea3d90

Please sign in to comment.