Skip to content

Commit

Permalink
Merge pull request #17 from VolVoz/beauty_test
Browse files Browse the repository at this point in the history
deleted unused tests
  • Loading branch information
vmaksymiv committed Feb 22, 2016
2 parents 596348f + aedef1b commit fa5b97d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
29 changes: 18 additions & 11 deletions openprocurement/tender/limited/tests/award.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,19 +331,26 @@ def test_patch_tender_award_unsuccessful(self):
response = self.app.patch_json('/tenders/{}/awards/{}?acc_token={}'.format(self.tender_id, award['id'], self.tender_token),
{"data": {"status": "unsuccessful"}})
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
# self.assertIn('Location', response.headers)
# new_award_location = response.headers['Location']

# response = self.app.patch_json(new_award_location[-81:], {"data": {"status": "unsuccessful"}})
# self.assertEqual(response.status, '200 OK')
# self.assertEqual(response.content_type, 'application/json')
# self.assertNotIn('Location', response.headers)
response = self.app.patch_json('/tenders/{}/awards/{}?acc_token={}'.format(self.tender_id, award['id'], self.tender_token),
{"data": {"title": 'award title'}}, status=403)
self.assertEqual(response.status, '403 Forbidden')
self.assertEqual(response.json['errors'][0]["description"], "Can't update award in current (unsuccessful) status")

response = self.app.patch_json('/tenders/{}/awards/{}?acc_token={}'.format(self.tender_id, award['id'], self.tender_token),
{"data": {"status": "active"}}, status=403)
self.assertEqual(response.status, '403 Forbidden')
self.assertEqual(response.json['errors'][0]["description"], "Can't update award in current (unsuccessful) status")

response = self.app.patch_json('/tenders/{}/awards/{}?acc_token={}'.format(self.tender_id, award['id'], self.tender_token),
{"data": {"status": "cancelled"}}, status=403)
self.assertEqual(response.status, '403 Forbidden')
self.assertEqual(response.json['errors'][0]["description"], "Can't update award in current (unsuccessful) status")

# response = self.app.get(request_path)
# self.assertEqual(response.status, '200 OK')
# self.assertEqual(response.content_type, 'application/json')
# self.assertEqual(len(response.json['data']), 2)
response = self.app.post('/tenders/{}/awards/{}/documents?acc_token={}'.format(self.tender_id, award['id'], self.tender_token),
upload_files=[('file', 'name.doc', 'content')], status=403)
self.assertEqual(response.status, '403 Forbidden')
self.assertEqual(response.json['errors'][0]["description"], "Can't add document in current (unsuccessful) award status")

def test_get_tender_award(self):
response = self.app.post_json('/tenders/{}/awards?acc_token={}'.format(
Expand Down
2 changes: 0 additions & 2 deletions openprocurement/tender/limited/tests/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ def test_put_tender_document(self):
req.environ['wsgi.input'] = BytesIO(body.encode(req.charset or 'utf8'))
req.content_length = len(body)
response = self.app.do_request(req)
#response = self.app.post('/tenders/{}/documents'.format(
#self.tender_id), upload_files=[('file', 'name.doc', 'content')])
self.assertEqual(response.status, '201 Created')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(u'укр.doc', response.json["data"]["title"])
Expand Down

0 comments on commit fa5b97d

Please sign in to comment.