Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/openprocurement/tender/belowthreshold/tests/award.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
# TenderAwardDocumentResourceTest
not_found_award_document,
create_tender_award_document,
put_tender_json_award_document_of_document,
put_tender_award_document,
patch_tender_award_document,
create_award_document_bot,
Expand Down Expand Up @@ -96,6 +97,7 @@ class TenderAwardDocumentResourceTestMixin(object):
test_not_found_award_document = snitch(not_found_award_document)
test_create_tender_award_document = snitch(create_tender_award_document)
test_put_tender_award_document = snitch(put_tender_award_document)
test_put_tender_json_award_document_of_document = snitch(put_tender_json_award_document_of_document)
test_patch_tender_award_document = snitch(patch_tender_award_document)
test_create_award_document_bot = snitch(create_award_document_bot)
test_patch_not_author = snitch(patch_not_author)
Expand Down
36 changes: 36 additions & 0 deletions src/openprocurement/tender/belowthreshold/tests/award_blanks.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,42 @@ def create_tender_award_no_scale(self):
self.assertNotIn("scale", response.json["data"]["suppliers"][0])


def put_tender_json_award_document_of_document(self):
response = self.app.post(
"/tenders/{}/awards/{}/documents?acc_token={}".format(self.tender_id, self.award_id, self.tender_token),
upload_files=[("file", "name.doc", "content")],
)
self.assertEqual(response.status, "201 Created")
self.assertEqual(response.content_type, "application/json")
document_id = response.json["data"]["id"]
response = self.app.patch_json(
"/tenders/{}/awards/{}/documents/{}?acc_token={}".format(self.tender_id, self.award_id,document_id, self.tender_token),
{"data": {
"title": u"укр.doc",
"url": self.generate_docservice_url(),
"hash": "md5:" + "0" * 32,
"format": "application/msword",
"documentOf": "document",
"relatedItem": "0"*32,
}}, status=422
)
self.assertEqual(response.status, "422 Unprocessable Entity")
self.assertEqual(response.content_type, "application/json")
self.assertEqual(
response.json["errors"],
[
{
u"location": u"body",
u"name": u"relatedItem",
u"description": [

u'relatedItem should be one of documents'
]
}
]
)


# TenderLotAwardResourceTest


Expand Down
20 changes: 20 additions & 0 deletions src/openprocurement/tender/belowthreshold/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,26 @@
"procurementMethodType": "belowThreshold",
"milestones": test_milestones,
}

test_tender_document_data = {
"url": "http://ds.prozorro.local/get/b97562e3f33c493297fd14dd6d8c50f0?KeyID=a8968c46&Signature=3OV7QC7f%2ByfcGTvpy0tf%2FaM%2BFRI6kkg1ImfEJlfAx5qi%2FLY7IIj7TFqtxgaPrzdd%2BWIOCe3O5Q7WhXkOdCB9CQ%3D%3D",
"documentType":"tenderNotice",
"title": "Notice.pdf",
"hash": "md5:00000000000000000000000000000000",
"format": "application/pdf"
}

test_tender_full_document_data = {
"hash": "md5:00000000000000000000000000000000",
"author": "tender_owner",
"format": "application/msword",
"title": "tender_document.doc",
"documentOf": "tender",
"datePublished": "2020-04-23T14:31:34.217330+03:00",
"dateModified": "2020-04-23T14:31:34.217368+03:00",
"id": uuid4().hex
}

if SANDBOX_MODE:
test_tender_data["procurementMethodDetails"] = "quick, accelerator=1440"
test_features_tender_data = test_tender_data.copy()
Expand Down
4 changes: 3 additions & 1 deletion src/openprocurement/tender/belowthreshold/tests/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ def setUp(self):
class TenderContractDocumentResourceTest(TenderContentWebTest, TenderContractDocumentResourceTestMixin):
initial_status = "active.qualification"
initial_bids = test_bids

docservice = True

def setUp(self):
super(TenderContractDocumentResourceTest, self).setUp()
# Create award
Expand Down Expand Up @@ -218,6 +219,7 @@ class Tender2LotContractDocumentResourceTest(TenderContentWebTest):
initial_status = "active.qualification"
initial_bids = test_bids
initial_lots = 2 * test_lots
docservice = True

def setUp(self):
super(Tender2LotContractDocumentResourceTest, self).setUp()
Expand Down
Loading