Skip to content

Commit

Permalink
Merge branch 'a433718495997911_satisfy_stopping_complaint' into produ…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
annawzz committed Oct 26, 2017
2 parents d6d18cf + fc39646 commit 3ccf6a4
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 132 deletions.
1 change: 0 additions & 1 deletion buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ openprocurement.tender.core = git https://github.com/openprocurement/openprocure
openprocurement.tender.belowthreshold = git https://github.com/openprocurement/openprocurement.tender.belowthreshold.git branch=production
openprocurement.tender.openua = git https://github.com/openprocurement/openprocurement.tender.openua.git branch=production


[test]
recipe = zc.recipe.egg:scripts
dependent-scripts = true
Expand Down
8 changes: 4 additions & 4 deletions docs/source/complaints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Tender Conditions Claims/Complaints
{pending,accepted} -> stopping;
edge[style=bold];
accepted -> {declined,satisfied,stopped};
pending -> {accepted,invalid};
stopping -> {stopped,invalid,declined};
pending -> {accepted,invalid,stopped};
stopping -> {stopped,invalid,declined,satisfied};
{pending;stopping} -> mistaken;
edge[label="auction" style=dotted];
answered -> {declined,resolved,invalid};
Expand Down Expand Up @@ -74,8 +74,8 @@ Tender Award Claims/Complaints
pending -> stopping;
accepted -> stopping;
edge[style=bold];
pending -> {accepted,invalid};
stopping -> {stopped,invalid,declined};
pending -> {accepted,invalid,stopped};
stopping -> {stopped,invalid,declined,satisfied};
accepted -> {declined,satisfied,stopped};
{pending;stopping} -> mistaken;
}
Expand Down
36 changes: 28 additions & 8 deletions openprocurement/tender/openuadefense/tests/award.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
create_tender_award_complaint,
patch_tender_award_complaint,
review_tender_award_complaint,
review_tender_award_claim,
review_tender_award_stopping_complaint,
# TenderLotAwardComplaintResourceTest
create_tender_lot_award_complaint,
patch_tender_lot_award_complaint,
Expand All @@ -63,10 +65,6 @@
)

from openprocurement.tender.openuadefense.tests.base import BaseTenderUAContentWebTest
from openprocurement.tender.openuadefense.tests.award_blanks import (
# TenderAwardComplaintResourceTest
review_tender_award_claim,
)


class TenderAwardResourceTest(BaseTenderUAContentWebTest):
Expand Down Expand Up @@ -109,18 +107,22 @@ def setUp(self):
super(TenderAwardComplaintResourceTest, self).setUp()
self.bid_token = self.initial_bids_tokens[self.initial_bids[0]['id']]
# Create award
auth = self.app.authorization
self.app.authorization = ('Basic', ('token', ''))
response = self.app.post_json('/tenders/{}/awards'.format(
self.tender_id), {'data': {'suppliers': [test_organization], 'status': 'pending', 'bid_id': self.initial_bids[0]['id']}})
award = response.json['data']
self.award_id = award['id']
self.app.patch_json('/tenders/{}/awards/{}'.format(self.tender_id, self.award_id), {'data': {'status': 'active', "qualified": True, "eligible": True}})
self.app.authorization = auth

test_create_tender_award_complaint_invalid = snitch(create_tender_award_complaint_invalid)
test_create_tender_award_claim = snitch(create_tender_award_claim)
test_create_tender_award_complaint_not_active = snitch(create_tender_award_complaint_not_active)
test_create_tender_award_complaint = snitch(create_tender_award_complaint)
test_patch_tender_award_complaint = snitch(patch_tender_award_complaint)
test_review_tender_award_complaint = snitch(review_tender_award_complaint)
test_review_tender_award_stopping_complaint = snitch(review_tender_award_stopping_complaint)
test_review_tender_award_claim = snitch(review_tender_award_claim)
test_get_tender_award_complaint = snitch(get_tender_award_complaint)
test_get_tender_award_complaints = snitch(get_tender_award_complaints)
Expand All @@ -136,11 +138,14 @@ def setUp(self):
# Create award
bid = self.initial_bids[0]
self.bid_token = self.initial_bids_tokens[self.initial_bids[0]['id']]
auth = self.app.authorization
self.app.authorization = ('Basic', ('token', ''))
response = self.app.post_json('/tenders/{}/awards'.format(
self.tender_id), {'data': {'suppliers': [test_organization], 'status': 'pending', 'bid_id': bid['id'], 'lotID': bid['lotValues'][0]['relatedLot']}})
award = response.json['data']
self.award_id = award['id']
self.app.patch_json('/tenders/{}/awards/{}'.format(self.tender_id, self.award_id), {'data': {'status': 'active', "qualified": True, "eligible": True}})
self.app.authorization = auth

test_create_tender_award_complaint = snitch(create_tender_lot_award_complaint)
test_patch_tender_award_complaint = snitch(patch_tender_lot_award_complaint)
Expand All @@ -162,14 +167,19 @@ class TenderAwardComplaintDocumentResourceTest(BaseTenderUAContentWebTest):
def setUp(self):
super(TenderAwardComplaintDocumentResourceTest, self).setUp()
# Create award
auth = self.app.authorization
self.app.authorization = ('Basic', ('token', ''))
response = self.app.post_json('/tenders/{}/awards'.format(
self.tender_id), {'data': {'suppliers': [test_organization], 'status': 'pending', 'bid_id': self.initial_bids[0]['id']}})
award = response.json['data']
self.award_id = award['id']
self.app.patch_json('/tenders/{}/awards/{}'.format(self.tender_id, self.award_id), {'data': {'status': 'active', "qualified": True, "eligible": True}})
self.app.authorization = auth

# Create complaint for award
response = self.app.post_json('/tenders/{}/awards/{}/complaints'.format(
self.tender_id, self.award_id), {'data': {'title': 'complaint title', 'description': 'complaint description', 'author': test_organization}})
bid_token = self.initial_bids_tokens[self.initial_bids[0]['id']]
response = self.app.post_json('/tenders/{}/awards/{}/complaints?acc_token={}'.format(
self.tender_id, self.award_id, bid_token), {'data': {'title': 'complaint title', 'description': 'complaint description', 'author': test_organization}})
complaint = response.json['data']
self.complaint_id = complaint['id']
self.complaint_owner_token = response.json['access']['token']
Expand All @@ -189,14 +199,18 @@ def setUp(self):
super(Tender2LotAwardComplaintDocumentResourceTest, self).setUp()
# Create award
bid = self.initial_bids[0]
bid_token = self.initial_bids_tokens[self.initial_bids[0]['id']]
auth = self.app.authorization
self.app.authorization = ('Basic', ('token', ''))
response = self.app.post_json('/tenders/{}/awards'.format(
self.tender_id), {'data': {'suppliers': [test_organization], 'status': 'pending', 'bid_id': bid['id'], 'lotID': bid['lotValues'][0]['relatedLot']}})
award = response.json['data']
self.award_id = award['id']
self.app.patch_json('/tenders/{}/awards/{}'.format(self.tender_id, self.award_id), {'data': {'status': 'active', "qualified": True, "eligible": True}})
self.app.authorization = auth
# Create complaint for award
response = self.app.post_json('/tenders/{}/awards/{}/complaints'.format(
self.tender_id, self.award_id), {'data': {'title': 'complaint title', 'description': 'complaint description', 'author': test_organization}})
response = self.app.post_json('/tenders/{}/awards/{}/complaints?acc_token={}'.format(
self.tender_id, self.award_id, bid_token), {'data': {'title': 'complaint title', 'description': 'complaint description', 'author': test_organization}})
complaint = response.json['data']
self.complaint_id = complaint['id']
self.complaint_owner_token = response.json['access']['token']
Expand All @@ -213,10 +227,13 @@ class TenderAwardDocumentResourceTest(BaseTenderUAContentWebTest, TenderAwardDoc
def setUp(self):
super(TenderAwardDocumentResourceTest, self).setUp()
# Create award
auth = self.app.authorization
self.app.authorization = ('Basic', ('token', ''))
response = self.app.post_json('/tenders/{}/awards'.format(
self.tender_id), {'data': {'suppliers': [test_organization], 'status': 'pending', 'bid_id': self.initial_bids[0]['id']}})
award = response.json['data']
self.award_id = award['id']
self.app.authorization = auth


class Tender2LotAwardDocumentResourceTest(BaseTenderUAContentWebTest):
Expand All @@ -228,10 +245,13 @@ def setUp(self):
super(Tender2LotAwardDocumentResourceTest, self).setUp()
# Create award
bid = self.initial_bids[0]
auth = self.app.authorization
self.app.authorization = ('Basic', ('token', ''))
response = self.app.post_json('/tenders/{}/awards'.format(
self.tender_id), {'data': {'suppliers': [test_organization], 'status': 'pending', 'bid_id': bid['id'], 'lotID': bid['lotValues'][0]['relatedLot']}})
award = response.json['data']
self.award_id = award['id']
self.app.authorization = auth

test_create_tender_award_document = snitch(create_tender_lots_award_document)
test_put_tender_award_document = snitch(put_tender_lots_award_document)
Expand Down
37 changes: 0 additions & 37 deletions openprocurement/tender/openuadefense/tests/award_blanks.py

This file was deleted.

8 changes: 0 additions & 8 deletions openprocurement/tender/openuadefense/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,6 @@ def go_to_enquiryPeriod_end(self):
}
})

def setUp(self):
super(BaseTenderWebTest, self).setUp()
self.app.authorization = ('Basic', ('token', ''))
self.couchdb_server = self.app.app.registry.couchdb_server
self.db = self.app.app.registry.db
if self.docservice:
self.setUpDS()

def set_status(self, status, extra=None):
data = {'status': status}
if status == 'active.tendering':
Expand Down
4 changes: 2 additions & 2 deletions openprocurement/tender/openuadefense/tests/cancellation.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class TenderCancellationDocumentResourceTest(BaseTenderUAContentWebTest,TenderCa
def setUp(self):
super(TenderCancellationDocumentResourceTest, self).setUp()
# Create cancellation
response = self.app.post_json('/tenders/{}/cancellations'.format(
self.tender_id), {'data': {'reason': 'cancellation reason'}})
response = self.app.post_json('/tenders/{}/cancellations?acc_token={}'.format(
self.tender_id, self.tender_token), {'data': {'reason': 'cancellation reason'}})
cancellation = response.json['data']
self.cancellation_id = cancellation['id']

Expand Down
16 changes: 13 additions & 3 deletions openprocurement/tender/openuadefense/tests/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,19 @@ class TenderContractResourceTest(BaseTenderUAContentWebTest, TenderContractResou
def setUp(self):
super(TenderContractResourceTest, self).setUp()
# Create award
authorization = self.app.authorization
self.app.authorization = ('Basic', ('token', ''))
response = self.app.post_json('/tenders/{}/awards'.format(
self.tender_id), {'data': {'suppliers': [test_organization], 'status': 'pending', 'bid_id': self.initial_bids[0]['id'],
'value': self.initial_bids[0]['value']}})
self.tender_id),
{'data': {'suppliers': [test_organization], 'status': 'pending', 'bid_id': self.initial_bids[0]['id'],
'value': self.initial_bids[0]['value']}})
award = response.json['data']
self.award_id = award['id']
response = self.app.patch_json('/tenders/{}/awards/{}'.format(self.tender_id, self.award_id), {"data": {"status": "active", "qualified": True, "eligible": True}})
self.award_value = award['value']
self.app.authorization = authorization
self.app.patch_json(
'/tenders/{}/awards/{}?acc_token={}'.format(self.tender_id, self.award_id, self.tender_token),
{"data": {"status": "active", "qualified": True, "eligible": True}})

test_create_tender_contract = snitch(create_tender_contract)
test_patch_tender_contract = snitch(patch_tender_contract)
Expand All @@ -46,6 +53,8 @@ class TenderContractDocumentResourceTest(BaseTenderUAContentWebTest, TenderContr
def setUp(self):
super(TenderContractDocumentResourceTest, self).setUp()
# Create award
auth = self.app.authorization
self.app.authorization = ('Basic', ('token', ''))
response = self.app.post_json('/tenders/{}/awards'.format(
self.tender_id), {'data': {'suppliers': [test_organization], 'status': 'pending', 'bid_id': self.initial_bids[0]['id']}})
award = response.json['data']
Expand All @@ -55,6 +64,7 @@ def setUp(self):
response = self.app.post_json('/tenders/{}/contracts'.format(self.tender_id), {'data': {'title': 'contract title', 'description': 'contract description', 'awardID': self.award_id}})
contract = response.json['data']
self.contract_id = contract['id']
self.app.authorization = auth


def suite():
Expand Down
2 changes: 1 addition & 1 deletion openprocurement/tender/openuadefense/tests/lot.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class TenderLotFeatureBidderResourceTest(BaseTenderUAContentWebTest):
def setUp(self):
super(TenderLotFeatureBidderResourceTest, self).setUp()
self.lot_id = self.initial_lots[0]['id']
response = self.app.patch_json('/tenders/{}'.format(self.tender_id), {"data": {
response = self.app.patch_json('/tenders/{}?acc_token={}'.format(self.tender_id, self.tender_token), {"data": {
"items": [
{
'relatedLot': self.lot_id,
Expand Down
27 changes: 21 additions & 6 deletions openprocurement/tender/openuadefense/tests/question.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@
patch_tender_question,
# TenderLotQuestionResourceTest
lot_create_tender_question,
lot_patch_tender_question,
)

from openprocurement.tender.openua.tests.question_blanks import (
# TenderQuestionResourceTest
create_tender_question,
# TenderLotQuestionResourceTest
tender_has_unanswered_questions,
lot_has_unanswered_questions,
item_has_unanswered_questions,
)

from openprocurement.tender.openuadefense.tests.base import BaseTenderUAContentWebTest
from openprocurement.tender.openuadefense.tests.question_blanks import (
# TenderLotQuestionResourceTest
patch_multilot_tender_question,
)


class TenderQuestionResourceTest(BaseTenderUAContentWebTest, TenderQuestionResourceTestMixin):
Expand All @@ -37,8 +38,22 @@ class TenderLotQuestionResourceTest(BaseTenderUAContentWebTest):
initial_lots = 2 * test_lots
author_data = test_organization

test_create_tender_question = snitch(lot_create_tender_question)
test_patch_tender_question = snitch(patch_multilot_tender_question)
def create_question_for(self, questionOf, relatedItem):
response = self.app.post_json('/tenders/{}/questions'.format(self.tender_id), {'data': {
'title': 'question title',
'description': 'question description',
"questionOf": questionOf,
"relatedItem": relatedItem,
'author': test_organization
}})
self.assertEqual(response.status, '201 Created')
return response.json['data']['id']

test_create_tender_lot_question = snitch(lot_create_tender_question)
test_patch_tender_lot_question = snitch(lot_patch_tender_question)
test_tender_has_unanswered_questions = snitch(tender_has_unanswered_questions)
test_lot_has_unanswered_questions = snitch(lot_has_unanswered_questions)
test_item_has_unanswered_questions = snitch(item_has_unanswered_questions)


def suite():
Expand Down
51 changes: 0 additions & 51 deletions openprocurement/tender/openuadefense/tests/question_blanks.py

This file was deleted.

Loading

0 comments on commit 3ccf6a4

Please sign in to comment.