Skip to content

Commit

Permalink
Merge branch 'master' of github.com:openprocurement/openprocurement.t…
Browse files Browse the repository at this point in the history
…ender.openua
  • Loading branch information
kroman0 committed Feb 1, 2016
2 parents 3b0d5cd + edb346d commit 7385ce6
Show file tree
Hide file tree
Showing 36 changed files with 325 additions and 336 deletions.
49 changes: 29 additions & 20 deletions docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def test_docs(self):
#

with open('docs/source/tutorial/tender-listing.http', 'w') as self.app.file_obj:
self.app.authorization = ('Basic', ('token', ''))
self.app.authorization = None
response = self.app.get(request_path)
self.assertEqual(response.status, '200 OK')
self.app.file_obj.write("\n")
Expand Down Expand Up @@ -260,7 +260,7 @@ def test_docs(self):
response = self.app.get(request_path)
self.assertEqual(response.status, '200 OK')

self.app.authorization = ('Basic', ('token', ''))
self.app.authorization = ('Basic', ('broker', ''))

#### Modifying tender
#
Expand All @@ -281,38 +281,38 @@ def test_docs(self):
self.assertEqual(response.status, '200 OK')


self.app.authorization = ('Basic', ('token', ''))
self.app.authorization = ('Basic', ('broker', ''))
self.tender_id = tender['id']

#### Uploading documentation
#

with open('docs/source/tutorial/upload-tender-notice.http', 'w') as self.app.file_obj:
response = self.app.post('/tenders/{}/documents'.format(
self.tender_id), upload_files=[('file', u'Notice.pdf', 'content')])
response = self.app.post('/tenders/{}/documents?acc_token={}'.format(
self.tender_id, owner_token), upload_files=[('file', u'Notice.pdf', 'content')])
self.assertEqual(response.status, '201 Created')

doc_id = response.json["data"]["id"]
with open('docs/source/tutorial/tender-documents.http', 'w') as self.app.file_obj:
response = self.app.get('/tenders/{}/documents/{}'.format(
self.tender_id, doc_id))
response = self.app.get('/tenders/{}/documents/{}?acc_token={}'.format(
self.tender_id, doc_id, owner_token))
self.assertEqual(response.status, '200 OK')

with open('docs/source/tutorial/upload-award-criteria.http', 'w') as self.app.file_obj:
response = self.app.post('/tenders/{}/documents'.format(
self.tender_id), upload_files=[('file', u'AwardCriteria.pdf', 'content')])
response = self.app.post('/tenders/{}/documents?acc_token={}'.format(
self.tender_id, owner_token), upload_files=[('file', u'AwardCriteria.pdf', 'content')])
self.assertEqual(response.status, '201 Created')

doc_id = response.json["data"]["id"]

with open('docs/source/tutorial/tender-documents-2.http', 'w') as self.app.file_obj:
response = self.app.get('/tenders/{}/documents'.format(
self.tender_id))
response = self.app.get('/tenders/{}/documents?acc_token={}'.format(
self.tender_id, owner_token))
self.assertEqual(response.status, '200 OK')

with open('docs/source/tutorial/update-award-criteria.http', 'w') as self.app.file_obj:
response = self.app.put('/tenders/{}/documents/{}'.format(
self.tender_id, doc_id), upload_files=[('file', 'AwardCriteria-2.pdf', 'content2')])
response = self.app.put('/tenders/{}/documents/{}?acc_token={}'.format(
self.tender_id, doc_id, owner_token), upload_files=[('file', 'AwardCriteria-2.pdf', 'content2')])
self.assertEqual(response.status, '200 OK')

with open('docs/source/tutorial/tender-documents-3.http', 'w') as self.app.file_obj:
Expand All @@ -330,8 +330,8 @@ def test_docs(self):
self.assertEqual(response.status, '201 Created')

with open('docs/source/tutorial/answer-question.http', 'w') as self.app.file_obj:
response = self.app.patch_json('/tenders/{}/questions/{}'.format(
self.tender_id, question_id), answer, status=200)
response = self.app.patch_json('/tenders/{}/questions/{}?acc_token={}'.format(
self.tender_id, question_id, owner_token), answer, status=200)
self.assertEqual(response.status, '200 OK')

with open('docs/source/tutorial/list-question.http', 'w') as self.app.file_obj:
Expand Down Expand Up @@ -467,13 +467,22 @@ def test_docs(self):

#### Confirming qualification
#
self.app.authorization = ('Basic', ('token', ''))
self.set_status('active.qualification')
# self.set_status('active.qualification')
self.app.authorization = ('Basic', ('auction', ''))
response = self.app.get('/tenders/{}/auction'.format(self.tender_id))
auction_bids_data = response.json['data']['bids']
response = self.app.post_json('/tenders/{}/auction'.format(self.tender_id),
{'data': {'bids': auction_bids_data}})

self.app.authorization = ('Basic', ('broker', ''))

response = self.app.get('/tenders/{}/awards?acc_token={}'.format(self.tender_id, owner_token))
# get pending award
award_id = [i['id'] for i in response.json['data'] if i['status'] == 'pending'][0]

with open('docs/source/tutorial/confirm-qualification.http', 'w') as self.app.file_obj:
response = self.app.post_json('/tenders/{}/awards?acc_token={}'.format(
self.tender_id, owner_token), {'data': {'suppliers': [tender["procuringEntity"]], 'status': 'pending', 'bid_id': bid1_id}})
self.assertEqual(response.status, '201 Created')
self.app.patch_json('/tenders/{}/awards/{}?acc_token={}'.format(self.tender_id, award_id, owner_token), {"data": {"status": "active"}})
self.assertEqual(response.status, '200 OK')



Expand Down
26 changes: 13 additions & 13 deletions docs/source/tutorial/active-cancellation.http
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PATCH /api/0.12/tenders/461c56e2c317479495b2b31e0878bb54/cancellations/927835c80a2644338f520f46564ee66a?acc_token=fe5acd1c6e29423297e5b88631be757f HTTP/1.0
Authorization: Basic dG9rZW46
PATCH /api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd/cancellations/3f946a8c094d4c109e84e6391e3da210?acc_token=0d8b9c3b5b5c4551829844cbbe979700 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 30
Content-Type: application/json
Host: api-sandbox.openprocurement.org

DATA:
{
"data": {
"status": "active"
Expand All @@ -19,27 +19,27 @@ Content-Type: application/json; charset=UTF-8
{
"description": "Changed description",
"title": "Notice.pdf",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/461c56e2c317479495b2b31e0878bb54/cancellations/927835c80a2644338f520f46564ee66a/documents/704e2904c91945b9957dcb196a836941?download=c89bdde16f1a490f9a244eca185a9df3",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd/cancellations/3f946a8c094d4c109e84e6391e3da210/documents/3a8ca7beea47400a901d121c6966c757?download=1649cf47c9fb45bb86e8f9fa429ad0ce",
"format": "application/pdf",
"documentOf": "tender",
"datePublished": "2016-01-28T14:57:32.382122+02:00",
"id": "704e2904c91945b9957dcb196a836941",
"dateModified": "2016-01-28T14:57:32.382159+02:00"
"datePublished": "2016-01-29T18:54:30.508297+02:00",
"id": "3a8ca7beea47400a901d121c6966c757",
"dateModified": "2016-01-29T18:54:30.508338+02:00"
},
{
"title": "Notice-2.pdf",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/461c56e2c317479495b2b31e0878bb54/cancellations/927835c80a2644338f520f46564ee66a/documents/704e2904c91945b9957dcb196a836941?download=948b8da1a59f4ed18f1c3e1f0a9aa807",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd/cancellations/3f946a8c094d4c109e84e6391e3da210/documents/3a8ca7beea47400a901d121c6966c757?download=1d39169b5cec428f9481dd1a66533798",
"format": "application/pdf",
"documentOf": "tender",
"datePublished": "2016-01-28T14:57:32.382122+02:00",
"id": "704e2904c91945b9957dcb196a836941",
"dateModified": "2016-01-28T14:57:32.746054+02:00"
"datePublished": "2016-01-29T18:54:30.508297+02:00",
"id": "3a8ca7beea47400a901d121c6966c757",
"dateModified": "2016-01-29T18:54:30.815776+02:00"
}
],
"reason": "cancellation reason",
"date": "2016-01-28T14:57:32.208772+02:00",
"date": "2016-01-29T18:54:30.366741+02:00",
"cancellationOf": "tender",
"id": "927835c80a2644338f520f46564ee66a"
"id": "3f946a8c094d4c109e84e6391e3da210"
}
}

10 changes: 5 additions & 5 deletions docs/source/tutorial/answer-question.http
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PATCH /api/0.12/tenders/461c56e2c317479495b2b31e0878bb54/questions/68df7df19866463591c3bf961967ae22 HTTP/1.0
Authorization: Basic dG9rZW46
PATCH /api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd/questions/1972a815713141218a113b5a72de2e78?acc_token=0d8b9c3b5b5c4551829844cbbe979700 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 162
Content-Type: application/json
Host: api-sandbox.openprocurement.org

DATA:
{
"data": {
"answer": "Таблицю додано в файлі \"Kalorijnist.xslx\""
Expand All @@ -16,9 +16,9 @@ Content-Type: application/json; charset=UTF-8
"data": {
"description": "Просимо додати таблицю потрібної калорійності харчування",
"title": "Калорійність",
"date": "2016-01-28T14:57:29.357956+02:00",
"date": "2016-01-29T18:54:27.580523+02:00",
"answer": "Таблицю додано в файлі \"Kalorijnist.xslx\"",
"id": "68df7df19866463591c3bf961967ae22",
"id": "1972a815713141218a113b5a72de2e78",
"questionOf": "tender"
}
}
Expand Down
4 changes: 2 additions & 2 deletions docs/source/tutorial/ask-question-after-enquiry-period.http
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
POST /api/0.12/tenders/461c56e2c317479495b2b31e0878bb54/questions HTTP/1.0
POST /api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd/questions HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 1506
Content-Type: application/json
Host: api-sandbox.openprocurement.org

DATA:
{
"data": {
"author": {
Expand Down
12 changes: 6 additions & 6 deletions docs/source/tutorial/ask-question.http
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
POST /api/0.12/tenders/461c56e2c317479495b2b31e0878bb54/questions HTTP/1.0
Authorization: Basic dG9rZW46
POST /api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd/questions HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 1506
Content-Type: application/json
Host: api-sandbox.openprocurement.org

DATA:
{
"data": {
"author": {
Expand Down Expand Up @@ -34,7 +34,7 @@ Host: api-sandbox.openprocurement.org

Response: 201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/0.12/tenders/461c56e2c317479495b2b31e0878bb54/questions/68df7df19866463591c3bf961967ae22
Location: http://api-sandbox.openprocurement.org/api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd/questions/1972a815713141218a113b5a72de2e78
{
"data": {
"description": "Просимо додати таблицю потрібної калорійності харчування",
Expand All @@ -60,8 +60,8 @@ Location: http://api-sandbox.openprocurement.org/api/0.12/tenders/461c56e2c31747
}
},
"title": "Калорійність",
"date": "2016-01-28T14:57:29.357956+02:00",
"id": "68df7df19866463591c3bf961967ae22",
"date": "2016-01-29T18:54:27.580523+02:00",
"id": "1972a815713141218a113b5a72de2e78",
"questionOf": "tender"
}
}
Expand Down
54 changes: 27 additions & 27 deletions docs/source/tutorial/auction-url.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GET /api/0.12/tenders/461c56e2c317479495b2b31e0878bb54 HTTP/1.0
GET /api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: api-sandbox.openprocurement.org

Expand All @@ -9,13 +9,13 @@ Content-Type: application/json; charset=UTF-8
"procurementMethod": "open",
"status": "active.auction",
"complaintPeriod": {
"startDate": "2016-01-12T14:57:26.982676+02:00",
"endDate": "2016-01-24T14:57:26.982676+02:00"
"startDate": "2016-01-13T18:54:24.695251+02:00",
"endDate": "2016-01-25T18:54:24.695251+02:00"
},
"auctionUrl": "http://auction-sandbox.openprocurement.org/tenders/461c56e2c317479495b2b31e0878bb54",
"auctionUrl": "http://auction-sandbox.openprocurement.org/tenders/b337832d657e4a07bdd0f6572b431fbd",
"enquiryPeriod": {
"startDate": "2016-01-12T14:57:26.982676+02:00",
"endDate": "2016-01-25T14:57:26.982676+02:00"
"startDate": "2016-01-13T18:54:24.695251+02:00",
"endDate": "2016-01-26T18:54:24.695251+02:00"
},
"submissionMethod": "electronicAuction",
"next_check": null,
Expand Down Expand Up @@ -43,53 +43,53 @@ Content-Type: application/json; charset=UTF-8
{
"description": "Просимо додати таблицю потрібної калорійності харчування",
"title": "Калорійність",
"date": "2016-01-28T14:57:29.357956+02:00",
"date": "2016-01-29T18:54:27.580523+02:00",
"answer": "Таблицю додано в файлі \"Kalorijnist.xslx\"",
"id": "68df7df19866463591c3bf961967ae22",
"id": "1972a815713141218a113b5a72de2e78",
"questionOf": "tender"
}
],
"owner": "broker",
"id": "461c56e2c317479495b2b31e0878bb54",
"id": "b337832d657e4a07bdd0f6572b431fbd",
"documents": [
{
"title": "Notice.pdf",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/461c56e2c317479495b2b31e0878bb54/documents/dce508778abd49fab0a60f70f9aed8d7?download=92ad5e60c14146aa887a42edc22042fe",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd/documents/b7bc73fb170b42a19952f1a1d2364f01?download=b95a30a7e0b844ab951db3c2d9aa0c4b",
"format": "application/pdf",
"documentOf": "tender",
"datePublished": "2016-01-28T14:57:28.892329+02:00",
"id": "dce508778abd49fab0a60f70f9aed8d7",
"dateModified": "2016-01-28T14:57:28.892357+02:00"
"datePublished": "2016-01-29T18:54:27.097745+02:00",
"id": "b7bc73fb170b42a19952f1a1d2364f01",
"dateModified": "2016-01-29T18:54:27.097775+02:00"
},
{
"title": "AwardCriteria.pdf",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/461c56e2c317479495b2b31e0878bb54/documents/7bb7aff4647f4afea7da3230899039b0?download=8d2a40e9285641c79011a3397f979144",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd/documents/788939576e9d4a10b834e66a3a49ba1f?download=56e3233242c4430b8228c79e5ab90ea3",
"format": "application/pdf",
"documentOf": "tender",
"datePublished": "2016-01-28T14:57:29.056204+02:00",
"id": "7bb7aff4647f4afea7da3230899039b0",
"dateModified": "2016-01-28T14:57:29.056249+02:00"
"datePublished": "2016-01-29T18:54:27.270059+02:00",
"id": "788939576e9d4a10b834e66a3a49ba1f",
"dateModified": "2016-01-29T18:54:27.270089+02:00"
},
{
"title": "AwardCriteria-2.pdf",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/461c56e2c317479495b2b31e0878bb54/documents/7bb7aff4647f4afea7da3230899039b0?download=396f5822c4794b6cbc99ab21bb8646ee",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd/documents/788939576e9d4a10b834e66a3a49ba1f?download=bb8d24c4eb36463ea8a927c267c14392",
"format": "application/pdf",
"documentOf": "tender",
"datePublished": "2016-01-28T14:57:29.056204+02:00",
"id": "7bb7aff4647f4afea7da3230899039b0",
"dateModified": "2016-01-28T14:57:29.191864+02:00"
"datePublished": "2016-01-29T18:54:27.270059+02:00",
"id": "788939576e9d4a10b834e66a3a49ba1f",
"dateModified": "2016-01-29T18:54:27.431821+02:00"
}
],
"title": "футляри до державних нагород",
"tenderID": "UA-2016-01-28-000001",
"dateModified": "2016-01-28T14:57:31.505420+02:00",
"tenderID": "UA-2016-01-29-000001",
"dateModified": "2016-01-29T18:54:29.498780+02:00",
"numberOfBids": 2,
"tenderPeriod": {
"startDate": "2016-01-12T14:57:26.982676+02:00",
"endDate": "2016-01-28T14:57:26.982676+02:00"
"startDate": "2016-01-13T18:54:24.695251+02:00",
"endDate": "2016-01-29T18:54:24.695251+02:00"
},
"auctionPeriod": {
"startDate": "2016-01-28T14:57:26.982676+02:00"
"startDate": "2016-01-29T18:54:24.695251+02:00"
},
"procurementMethodType": "aboveThresholdUA",
"minimalStep": {
Expand All @@ -112,7 +112,7 @@ Content-Type: application/json; charset=UTF-8
"description": "Послуги шкільних їдалень"
}
],
"id": "ba012b4a8aa34c9bbf4a3bdf913924c0",
"id": "03636c21a8f943dcb8fac93d020240f3",
"unit": {
"code": "44617100-9",
"name": "item"
Expand Down
16 changes: 8 additions & 8 deletions docs/source/tutorial/bidder-activate-after-changing-tender.http
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PATCH /api/0.12/tenders/461c56e2c317479495b2b31e0878bb54/bids/5466d19b48f94d8181e0c08e7aaa1271?acc_token=b11ac3e26c4b490390dba0ffac5c42c9 HTTP/1.0
PATCH /api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd/bids/a9f37bcc9782472c9544ff5f5f1d8930?acc_token=c32254ff571b4713b60bd596f94992a1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 30
Content-Type: application/json
Host: api-sandbox.openprocurement.org

DATA:
{
"data": {
"status": "active"
Expand All @@ -18,12 +18,12 @@ Content-Type: application/json; charset=UTF-8
"documents": [
{
"title": "Proposal.pdf",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/461c56e2c317479495b2b31e0878bb54/bids/5466d19b48f94d8181e0c08e7aaa1271/documents/303cff22ddee4042aa2f1c038fc556a5?download=d7ccccf23b2549bb8fd645aa86fd8752",
"url": "http://api-sandbox.openprocurement.org/api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd/bids/a9f37bcc9782472c9544ff5f5f1d8930/documents/8deed6861e6a4a6d9c52a7bd2d74185c?download=87ad2f04cd574004b5c2bca065be123d",
"format": "application/pdf",
"documentOf": "tender",
"datePublished": "2016-01-28T14:57:30.247720+02:00",
"id": "303cff22ddee4042aa2f1c038fc556a5",
"dateModified": "2016-01-28T14:57:30.247774+02:00"
"datePublished": "2016-01-29T18:54:28.434505+02:00",
"id": "8deed6861e6a4a6d9c52a7bd2d74185c",
"dateModified": "2016-01-29T18:54:28.434544+02:00"
}
],
"value": {
Expand Down Expand Up @@ -53,8 +53,8 @@ Content-Type: application/json; charset=UTF-8
}
}
],
"date": "2016-01-28T14:57:30.091359+02:00",
"id": "5466d19b48f94d8181e0c08e7aaa1271"
"date": "2016-01-29T18:54:28.274068+02:00",
"id": "a9f37bcc9782472c9544ff5f5f1d8930"
}
}

4 changes: 2 additions & 2 deletions docs/source/tutorial/bidder-after-changing-tender.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GET /api/0.12/tenders/461c56e2c317479495b2b31e0878bb54/bids/5466d19b48f94d8181e0c08e7aaa1271?acc_token=b11ac3e26c4b490390dba0ffac5c42c9 HTTP/1.0
GET /api/0.12/tenders/b337832d657e4a07bdd0f6572b431fbd/bids/a9f37bcc9782472c9544ff5f5f1d8930?acc_token=c32254ff571b4713b60bd596f94992a1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Host: api-sandbox.openprocurement.org

Expand All @@ -7,7 +7,7 @@ Content-Type: application/json; charset=UTF-8
{
"data": {
"status": "invalid",
"id": "5466d19b48f94d8181e0c08e7aaa1271"
"id": "a9f37bcc9782472c9544ff5f5f1d8930"
}
}

0 comments on commit 7385ce6

Please sign in to comment.