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 Aug 1, 2016
2 parents b215f2a + 0b8b72d commit 2dddb17
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
16 changes: 7 additions & 9 deletions openprocurement/tender/openua/tests/award.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,10 +1790,9 @@ 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), 'content', 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.set_status('complete')

Expand Down Expand Up @@ -1958,10 +1957,9 @@ def test_put_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), 'content', 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")

response = self.app.post_json('/tenders/{}/cancellations?acc_token={}'.format(self.tender_id, self.tender_token), {'data': {
'reason': 'cancellation reason',
Expand Down Expand Up @@ -2008,10 +2006,10 @@ def test_patch_tender_award_complaint_document(self):
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.json['data']["status"], "pending")

response = self.app.patch_json('/tenders/{}/awards/{}/complaints/{}/documents/{}?acc_token={}'.format(self.tender_id, self.award_id, self.complaint_id, doc_id, self.complaint_owner_token), {"data": {"description": "document description"}}, status=403)
self.assertEqual(response.status, '403 Forbidden')
response = self.app.patch_json('/tenders/{}/awards/{}/complaints/{}/documents/{}?acc_token={}'.format(self.tender_id, self.award_id, self.complaint_id, doc_id, self.complaint_owner_token), {"data": {"description": "document description2"}})
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(response.json['data']["description"], "document description2")

response = self.app.post_json('/tenders/{}/cancellations?acc_token={}'.format(self.tender_id, self.tender_token), {'data': {
'reason': 'cancellation reason',
Expand Down
11 changes: 5 additions & 6 deletions openprocurement/tender/openua/tests/complaint.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,9 @@ def test_put_tender_complaint_document(self):
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.json['data']["status"], "pending")

response = self.app.put('/tenders/{}/complaints/{}/documents/{}?acc_token={}'.format(self.tender_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/{}/complaints/{}/documents/{}?acc_token={}'.format(self.tender_id, self.complaint_id, doc_id, self.complaint_owner_token), 'content', 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.set_status('complete')

Expand Down Expand Up @@ -736,10 +735,10 @@ def test_patch_tender_complaint_document(self):
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.json['data']["status"], "pending")

response = self.app.patch_json('/tenders/{}/complaints/{}/documents/{}?acc_token={}'.format(self.tender_id, self.complaint_id, doc_id, self.complaint_owner_token), {"data": {"description": "document description"}}, status=403)
self.assertEqual(response.status, '403 Forbidden')
response = self.app.patch_json('/tenders/{}/complaints/{}/documents/{}?acc_token={}'.format(self.tender_id, self.complaint_id, doc_id, self.complaint_owner_token), {"data": {"description": "document description2"}})
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(response.json['data']["description"], "document description2")

self.set_status('complete')

Expand Down
4 changes: 2 additions & 2 deletions openprocurement/tender/openua/views/complaint_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@


STATUS4ROLE = {
'complaint_owner': ['draft', 'answered', 'claim'],
'complaint_owner': ['draft', 'answered', 'claim', 'pending', 'accepted', 'satisfied'],
'aboveThresholdReviewers': ['pending', 'accepted', 'stopping'],
'tender_owner': ['claim', 'satisfied'],
'tender_owner': ['claim', 'pending', 'accepted', 'satisfied'],
}


Expand Down

0 comments on commit 2dddb17

Please sign in to comment.