Skip to content

Commit

Permalink
fit to view changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vmaksymiv committed May 13, 2016
1 parent b5c1b41 commit 6d8f8d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions openprocurement/contracting/api/tests/change.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ def test_create_change_invalid(self):
response = self.app.patch_json('/contracts/{}?acc_token={}'.format(self.contract['id'], self.contract_token),
{'data': {'changes': [{'rationale': "penguin"}]}})
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.body, 'null')

response = self.app.get('/contracts/{}?acc_token={}'.format(self.contract['id'], self.contract_token))
self.assertEqual(response.status, '200 OK')
self.assertNotIn('changes', response.json['data'])

def test_create_change(self):
Expand Down
9 changes: 6 additions & 3 deletions openprocurement/contracting/api/tests/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,9 @@ def test_patch_tender_contract(self):
# {"data": {"value": {"valueAddedTaxIncluded": False}}})

response = self.app.patch_json('/contracts/{}?acc_token={}'.format(self.contract['id'], token),
{"data": {"value": {"amount": 238}}})
{"data": {"value": {"amount": 235}}})
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.json['data']['value']['amount'], 238)
self.assertEqual(response.json['data']['value']['amount'], 235)

custom_period_start_date = get_now().isoformat()
custom_period_end_date = (get_now() + timedelta(days=3)).isoformat()
Expand Down Expand Up @@ -694,7 +694,7 @@ def test_patch_tender_contract(self):
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['data']["status"], "terminated")
self.assertEqual(response.json['data']["value"]['amount'], 238)
self.assertEqual(response.json['data']["value"]['amount'], 235)
self.assertEqual(response.json['data']['period']['startDate'], custom_period_start_date)
self.assertEqual(response.json['data']['period']['endDate'], custom_period_end_date)

Expand Down Expand Up @@ -739,6 +739,9 @@ def test_contract_administrator_change(self):
'contractID': "UA-00-00-00",
'dateSigned': get_now().isoformat(),
}})
self.assertEqual(response.body, 'null')

response = self.app.get('/contracts/{}'.format(self.contract['id']))
self.assertEqual(response.json['data']['value']['amount'], 238)
self.assertEqual(response.json['data']['id'], self.initial_data['id'])
self.assertEqual(response.json['data']['owner'], self.initial_data['owner'])
Expand Down

0 comments on commit 6d8f8d7

Please sign in to comment.