Skip to content

Commit

Permalink
Merge branch 'a147507835786741_complaint_document_upload_condition'
Browse files Browse the repository at this point in the history
  • Loading branch information
vmaksymiv committed Sep 16, 2016
2 parents 5c435b4 + 57ffb18 commit f31ade2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
14 changes: 11 additions & 3 deletions openprocurement/tender/limited/tests/award.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,10 +1134,18 @@ def test_patch_tender_award_complaint_document(self):
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.json['data']["status"], "pending")

response = self.app.put('/tenders/{}/awards/{}/complaints/{}/documents/{}?acc_token={}'.format(self.tender_id, self.award_id, self.complaint_id, doc_id, self.complaint_owner_token), 'content', content_type='application/msword', status=403)
self.assertEqual(response.status, '403 Forbidden')
response = self.app.put('/tenders/{}/awards/{}/complaints/{}/documents/{}?acc_token={}'.format(self.tender_id, self.award_id, self.complaint_id, doc_id, self.complaint_owner_token), 'contentX', content_type='application/msword')
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['errors'][0]["description"], "Can't update document in current (pending) complaint status")
self.assertEqual(doc_id, response.json["data"]["id"])
key = response.json["data"]["url"].split('?')[-1]

response = self.app.get('/tenders/{}/awards/{}/complaints/{}/documents/{}?{}'.format(
self.tender_id, self.award_id, self.complaint_id, doc_id, key))
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/msword')
self.assertEqual(response.content_length, 8)
self.assertEqual(response.body, 'contentX')

self.set_status('complete')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# -*- coding: utf-8 -*-
from openprocurement.api.utils import opresource
from openprocurement.tender.openua.views.award_complaint_document import TenderUaAwardComplaintDocumentResource

STATUS4ROLE = {
'complaint_owner': ['draft', 'answered', 'claim'],
'aboveThresholdReviewers': ['pending', 'accepted', 'stopping'],
'tender_owner': ['claim', 'satisfied'],
}
from openprocurement.tender.openua.views.complaint_document import STATUS4ROLE


@opresource(name='Tender negotiation Award Complaint Documents',
Expand Down

0 comments on commit f31ade2

Please sign in to comment.