Skip to content

Commit

Permalink
Merge pull request #18 from VolVoz/fixed_state_change_tests
Browse files Browse the repository at this point in the history
fixed state change tests
  • Loading branch information
vmaksymiv committed Feb 22, 2016
2 parents fa5b97d + 8df3910 commit 793769d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions openprocurement/tender/limited/tests/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,18 @@ def test_patch_tender_contract(self):
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['data']["status"], "active")

response = self.app.patch_json('/tenders/{}/contracts/{}?acc_token={}'.format(
self.tender_id, self.contract_id, self.tender_token), {"data": {"status": "cancelled"}}, status=403)
self.assertEqual(response.status, '403 Forbidden')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['errors'][0]["description"], "Can't update contract in current (complete) tender status")

response = self.app.patch_json('/tenders/{}/contracts/{}?acc_token={}'.format(
self.tender_id, self.contract_id, self.tender_token), {"data": {"status": "pending"}}, status=403)
self.assertEqual(response.status, '403 Forbidden')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['errors'][0]["description"], "Can't update contract in current (complete) tender status")

response = self.app.patch_json('/tenders/{}/contracts/{}?acc_token={}'.format(self.tender_id, self.contract_id, self.tender_token),
{"data": {"status": "active"}}, status=403)
self.assertEqual(response.status, '403 Forbidden')
Expand Down

0 comments on commit 793769d

Please sign in to comment.