Skip to content

Commit

Permalink
Fix migration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Leitsius committed Jun 6, 2017
1 parent 58f44dc commit 00bdb17
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions openprocurement/auctions/dgf/tests/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ def test_migrate_pending_to_complete(self):
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['data']['status'], u'active.awarded')

response = self.app.post('/auctions/{}/contracts/{}/documents'.format(
self.auction_id, contract['id']), upload_files=[('file', 'contract.doc', 'content')])
self.assertEqual(response.status, '201 Created')
self.assertEqual(response.content_type, 'application/json')

response = self.app.patch_json('/auctions/{}/contracts/{}'.format(self.auction_id, contract['id']), {"data": {"status": "active"}})
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
Expand Down Expand Up @@ -741,6 +746,11 @@ def test_migrate_active_to_complete(self):
self.assertEqual(response.json['data'][0]['status'], u'active')
self.assertEqual(response.json['data'][1]['status'], u'pending.waiting')

response = self.app.post('/auctions/{}/contracts/{}/documents'.format(
self.auction_id, contract_id), upload_files=[('file', 'contract.doc', 'content')])
self.assertEqual(response.status, '201 Created')
self.assertEqual(response.content_type, 'application/json')

response = self.app.patch_json('/auctions/{}/contracts/{}'.format(self.auction_id, contract_id), {"data": {"status": "active"}})
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
Expand Down Expand Up @@ -834,6 +844,11 @@ def test_migrate_cancelled_pending_to_complete(self):
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['data']['status'], u'active.awarded')

response = self.app.post('/auctions/{}/contracts/{}/documents'.format(
self.auction_id, contract['id']), upload_files=[('file', 'contract.doc', 'content')])
self.assertEqual(response.status, '201 Created')
self.assertEqual(response.content_type, 'application/json')

response = self.app.patch_json('/auctions/{}/contracts/{}'.format(self.auction_id, contract['id']), {"data": {"status": "active"}})
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
Expand Down Expand Up @@ -897,6 +912,11 @@ def test_migrate_unsuccessful_pending_to_complete(self):
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['data']['status'], u'active.awarded')

response = self.app.post('/auctions/{}/contracts/{}/documents'.format(
self.auction_id, contract['id']), upload_files=[('file', 'contract.doc', 'content')])
self.assertEqual(response.status, '201 Created')
self.assertEqual(response.content_type, 'application/json')

response = self.app.patch_json('/auctions/{}/contracts/{}'.format(self.auction_id, contract['id']), {"data": {"status": "active"}})
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
Expand Down Expand Up @@ -986,6 +1006,11 @@ def test_migrate_unsuccessful_active_to_complete(self):
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['data']['status'], u'active.awarded')

response = self.app.post('/auctions/{}/contracts/{}/documents'.format(
self.auction_id, contract['id']), upload_files=[('file', 'contract.doc', 'content')])
self.assertEqual(response.status, '201 Created')
self.assertEqual(response.content_type, 'application/json')

response = self.app.patch_json('/auctions/{}/contracts/{}'.format(self.auction_id, contract['id']), {"data": {"status": "active"}})
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
Expand Down Expand Up @@ -1055,6 +1080,11 @@ def test_migrate_cancelled_unsuccessful_pending(self):
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['data']['status'], u'active.awarded')

response = self.app.post('/auctions/{}/contracts/{}/documents'.format(
self.auction_id, contract['id']), upload_files=[('file', 'contract.doc', 'content')])
self.assertEqual(response.status, '201 Created')
self.assertEqual(response.content_type, 'application/json')

response = self.app.patch_json('/auctions/{}/contracts/{}'.format(self.auction_id, contract['id']), {"data": {"status": "active"}})
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
Expand Down

0 comments on commit 00bdb17

Please sign in to comment.