Esempio n. 1
0
class TenderLotFeatureBidderResourceTest(BaseTenderContentWebTest):
    initial_lots = test_lots
    initial_auth = ("Basic", ("broker", ""))
    initial_data = test_tender_data
    test_bids_data = test_bids  # TODO: change attribute identifier

    def setUp(self):
        super(TenderLotFeatureBidderResourceTest, self).setUp()
        self.lot_id = self.initial_lots[0]["id"]
        response = self.app.patch_json(
            "/tenders/{}?acc_token={}".format(self.tender_id,
                                              self.tender_token),
            {
                "data": {
                    "items": [{
                        "relatedLot": self.lot_id,
                        "id": "1"
                    }],
                    "features": [
                        {
                            "code":
                            "code_item",
                            "featureOf":
                            "item",
                            "relatedItem":
                            "1",
                            "title":
                            u"item feature",
                            "enum": [{
                                "value": 0.01,
                                "title": u"good"
                            }, {
                                "value": 0.02,
                                "title": u"best"
                            }],
                        },
                        # {
                        #     "code": "code_lot",
                        #     "featureOf": "lot",
                        #     "relatedItem": self.lot_id,
                        #     "title": u"lot feature",
                        #     "enum": [
                        #         {
                        #             "value": 0.01,
                        #             "title": u"good"
                        #         },
                        #         {
                        #             "value": 0.02,
                        #             "title": u"best"
                        #         }
                        #     ]
                        # },
                        {
                            "code":
                            "code_tenderer",
                            "featureOf":
                            "tenderer",
                            "title":
                            u"tenderer feature",
                            "enum": [{
                                "value": 0.01,
                                "title": u"good"
                            }, {
                                "value": 0.02,
                                "title": u"best"
                            }],
                        },
                    ],
                }
            },
        )
        self.assertEqual(response.status, "200 OK")
        self.assertEqual(response.content_type, "application/json")
        self.assertEqual(response.json["data"]["items"][0]["relatedLot"],
                         self.lot_id)

    test_create_tender_bidder_invalid = snitch(
        create_tender_feature_bidder_invalid)
    test_create_tender_bidder = snitch(create_tender_feature_bidder)
class TenderDocumentResourceTest(TenderContentWebTest, TenderDocumentResourceTestMixin):

    test_create_document_active_tendering_status = snitch(create_document_active_tendering_status)
class ContractNoItemsChangeTest(BaseWebTest):
    initial_data = test_contract_data
    test_no_items_contract_change = snitch(no_items_contract_change)
class TenderQualificationComplaintDocumentResourceTest(BaseTenderContentWebTest
                                                       ):
    initial_status = "active.tendering"  # 'active.pre-qualification.stand-still' status sets in setUp
    initial_bids = test_bids
    initial_auth = ("Basic", ("broker", ""))
    author_data = test_author

    def setUp(self):
        super(TenderQualificationComplaintDocumentResourceTest, self).setUp()

        # update periods to have possibility to change tender status by chronograph
        self.set_status("active.pre-qualification",
                        extra={"status": "active.tendering"})

        # simulate chronograph tick
        auth = self.app.authorization
        self.app.authorization = ("Basic", ("chronograph", ""))
        response = self.app.patch_json("/tenders/{}".format(self.tender_id),
                                       {"data": {
                                           "id": self.tender_id
                                       }})
        self.assertEqual(response.json["data"]["status"],
                         "active.pre-qualification")
        self.app.authorization = auth

        response = self.app.get("/tenders/{}/qualifications".format(
            self.tender_id))
        self.assertEqual(response.content_type, "application/json")
        qualifications = response.json["data"]
        self.qualification_id = qualifications[0]["id"]

        for qualification in qualifications:
            response = self.app.patch_json(
                "/tenders/{}/qualifications/{}?acc_token={}".format(
                    self.tender_id, qualification["id"], self.tender_token),
                {
                    "data": {
                        "status": "active",
                        "qualified": True,
                        "eligible": True
                    }
                },
            )
            self.assertEqual(response.status, "200 OK")
            self.assertEqual(response.json["data"]["status"], "active")

        response = self.app.patch_json(
            "/tenders/{}?acc_token={}".format(self.tender_id,
                                              self.tender_token),
            {"data": {
                "status": "active.pre-qualification.stand-still"
            }},
        )
        self.assertEqual(response.status, "200 OK")

        # Create complaint for qualification
        response = self.app.post_json(
            "/tenders/{}/qualifications/{}/complaints?acc_token={}".format(
                self.tender_id, self.qualification_id,
                self.initial_bids_tokens.values()[0]),
            {"data": test_draft_claim},
        )
        complaint = response.json["data"]
        self.complaint_id = complaint["id"]
        self.complaint_owner_token = response.json["access"]["token"]

    test_not_found = snitch(complaint_not_found)
    test_create_tender_qualification_complaint_document = snitch(
        create_tender_qualification_complaint_document)
    test_put_tender_qualification_complaint_document = snitch(
        put_tender_qualification_complaint_document)
    test_patch_tender_qualification_complaint_document = snitch(
        patch_tender_qualification_complaint_document)
class TenderDocumentResourceTestMixin(object):
    test_not_found = snitch(not_found)
    test_create_tender_document = snitch(create_tender_document)
    test_put_tender_document = snitch(put_tender_document)
    test_patch_tender_document = snitch(patch_tender_document)
Esempio n. 6
0
class TenderLotsCancellationResourceTest(BaseTenderContentWebTest):
    initial_lots = 2 * test_lots

    initial_auth = ("Basic", ("broker", ""))
    test_create_tender_cancellation = snitch(create_tender_lots_cancellation)
    test_patch_tender_cancellation = snitch(patch_tender_lots_cancellation)
class TenderQualificationComplaintResourceTest(BaseTenderContentWebTest):
    initial_status = "active.tendering"  # 'active.pre-qualification.stand-still' status sets in setUp
    initial_bids = test_bids
    initial_auth = ("Basic", ("broker", ""))
    author_data = test_author

    def setUp(self):
        super(TenderQualificationComplaintResourceTest, self).setUp()

        # update periods to have possibility to change tender status by chronograph
        self.set_status("active.pre-qualification",
                        extra={"status": "active.tendering"})

        # simulate chronograph tick
        auth = self.app.authorization
        self.app.authorization = ("Basic", ("chronograph", ""))
        response = self.app.patch_json("/tenders/{}".format(self.tender_id),
                                       {"data": {
                                           "id": self.tender_id
                                       }})
        self.assertEqual(response.json["data"]["status"],
                         "active.pre-qualification")
        self.app.authorization = auth

        response = self.app.get("/tenders/{}/qualifications".format(
            self.tender_id))
        self.assertEqual(response.content_type, "application/json")
        qualifications = response.json["data"]
        self.qualification_id = qualifications[0]["id"]

        for qualification in qualifications:
            response = self.app.patch_json(
                "/tenders/{}/qualifications/{}?acc_token={}".format(
                    self.tender_id, qualification["id"], self.tender_token),
                {
                    "data": {
                        "status": "active",
                        "qualified": True,
                        "eligible": True
                    }
                },
            )
            self.assertEqual(response.status, "200 OK")
            self.assertEqual(response.json["data"]["status"], "active")

        response = self.app.patch_json(
            "/tenders/{}?acc_token={}".format(self.tender_id,
                                              self.tender_token),
            {"data": {
                "status": "active.pre-qualification.stand-still"
            }},
        )
        self.assertEqual(response.status, "200 OK")

    test_create_tender_qualification_complaint_invalid = snitch(
        create_tender_qualification_complaint_invalid)
    test_create_tender_qualification_complaint = snitch(
        create_tender_qualification_complaint)
    test_patch_tender_qualification_complaint = snitch(
        patch_tender_qualification_complaint)
    test_review_tender_qualification_complaint = snitch(
        review_tender_qualification_complaint)
    test_review_tender_qualification_stopping_complaint = snitch(
        review_tender_qualification_stopping_complaint)
    test_review_tender_award_claim = snitch(review_tender_award_claim)
    test_get_tender_qualification_complaint = snitch(
        get_tender_qualification_complaint)
    test_get_tender_qualification_complaints = snitch(
        get_tender_qualification_complaints)
    test_change_status_to_standstill_with_complaint = snitch(
        change_status_to_standstill_with_complaint)
    test_bot_patch_tender_qualification_complaint = snitch(
        bot_patch_tender_qualification_complaint)
    test_bot_patch_tender_qualification_complaint_forbidden = snitch(
        bot_patch_tender_qualification_complaint_forbidden)
Esempio n. 8
0
class TenderFeaturesLotAuctionResourceTest(TenderLotAuctionResourceTestMixin,
                                           TenderFeaturesAuctionResourceTest):
    initial_lots = test_lots
    test_get_tender_auction = snitch(get_tender_lot_auction_features)
    test_post_tender_auction = snitch(post_tender_lot_auction_features)
Esempio n. 9
0
class TenderSameValueAuctionResourceTest(BaseTenderContentWebTest):

    initial_status = 'active.auction'
    tenderer_info = deepcopy(test_organization)
    initial_bids = [{
        "tenderers": [tenderer_info],
        "value": {
            "amount": 469,
            "currency": "UAH",
            "valueAddedTaxIncluded": True
        },
        'selfQualified': True,
        'selfEligible': True
    } for i in range(3)]

    def setUp(self):
        super(TenderSameValueAuctionResourceTest, self).setUp()
        auth = self.app.authorization
        # switch to active.pre-qualification
        self.set_status('active.pre-qualification',
                        {'status': 'active.tendering'})
        self.app.authorization = ('Basic', ('chronograph', ''))
        response = self.app.patch_json('/tenders/{}'.format(self.tender_id),
                                       {"data": {
                                           "id": self.tender_id
                                       }})
        self.assertEqual(response.status, "200 OK")
        self.assertEqual(response.json['data']['status'],
                         "active.pre-qualification")
        self.app.authorization = auth

        response = self.app.get('/tenders/{}/qualifications'.format(
            self.tender_id))
        for qualific in response.json['data']:
            response = self.app.patch_json(
                '/tenders/{}/qualifications/{}'.format(self.tender_id,
                                                       qualific['id']),
                {
                    'data': {
                        "status": "active",
                        "qualified": True,
                        "eligible": True
                    }
                })
            self.assertEqual(response.status, '200 OK')

        # switch to active.pre-qualification.stand-still
        response = self.app.patch_json(
            '/tenders/{}?acc_token={}'.format(self.tender_id,
                                              self.tender_token),
            {"data": {
                "status": "active.pre-qualification.stand-still"
            }})
        self.assertEqual(response.status, "200 OK")
        self.assertEqual(response.json['data']['status'],
                         "active.pre-qualification.stand-still")

        # switch to active.auction
        self.set_status('active.auction',
                        {'status': 'active.pre-qualification.stand-still'})
        self.app.authorization = ('Basic', ('chronograph', ''))
        response = self.app.patch_json('/tenders/{}'.format(self.tender_id),
                                       {"data": {
                                           "id": self.tender_id
                                       }})
        self.assertEqual(response.status, "200 OK")
        self.assertEqual(response.json['data']['status'], "active.auction")
        self.app.authorization = auth

    test_post_tender_auction_not_changed = snitch(
        post_tender_auction_not_changed)
    test_post_tender_auction_reversed = snitch(post_tender_auction_reversed)
Esempio n. 10
0
class TenderLotSwitch1BidResourceTest(BaseSimpleDefContentWebTest):
    initial_lots = test_lots
    initial_bids = test_bids[:1]

    test_switch_to_qualification = snitch(switch_to_qualification)
Esempio n. 11
0
class TenderMultipleLotAuctionResourceTest(
        TenderMultipleLotAuctionResourceTestMixin, TenderAuctionResourceTest):
    initial_lots = 2 * test_lots

    test_patch_tender_auction = snitch(patch_tender_2lot_auction)
Esempio n. 12
0
class TenderLotSwitch0BidResourceTest(BaseSimpleDefContentWebTest):
    initial_lots = test_lots

    test_switch_to_unsuccessful = snitch(without_bids_switch_to_unsuccessful)

    test_set_auction_period = snitch(without_bids_set_auction_period)
Esempio n. 13
0
class TenderSwitch1BidResourceTest(BaseSimpleDefContentWebTest):
    initial_bids = test_bids[:1]

    test_not_switch_to_unsuccessful = snitch(not_switch_to_unsuccessful)
Esempio n. 14
0
class TenderSwitch0BidResourceTest(BaseSimpleDefContentWebTest):

    test_switch_to_unsuccessful = snitch(switch_to_unsuccessful_belowthreshold)

    test_set_auction_period = snitch(set_auction_period_0bid)
class TenderAgreementResourceTestMixin(object):
    test_get_tender_agreement = snitch(get_tender_agreement)
    test_get_tender_agreements = snitch(get_tender_agreements)
    test_get_tender_agreement_contract = snitch(get_tender_agreement_contract)
    test_get_tender_agreement_contracts = snitch(get_tender_agreement_contracts)
Esempio n. 16
0
class TenderLotAwardComplaintResourceTest(BaseTenderUAContentWebTest):
    initial_lots = test_lots
    test_author = test_author

    test_create_tender_complaint = snitch(create_tender_lot_complaint)
Esempio n. 17
0
class TenderCancellationResourceTest(BaseTenderContentWebTest, TenderCancellationResourceTestMixin):

    initial_auth = ("Basic", ("broker", ""))

    test_create_tender_cancellation = snitch(create_tender_cancellation)
    test_patch_tender_cancellation = snitch(patch_tender_cancellation)
class TenderCancellationResourceTestMixin(object):
    test_create_tender_cancellation_invalid = snitch(create_tender_cancellation_invalid)
    test_create_tender_cancellation = snitch(create_tender_cancellation)
    test_patch_tender_cancellation = snitch(patch_tender_cancellation)
    test_get_tender_cancellation = snitch(get_tender_cancellation)
    test_get_tender_cancellations = snitch(get_tender_cancellations)
Esempio n. 19
0
class TenderBidDocumentResourceTest(BaseTenderUAContentWebTest,
                                    TenderBidDocumentResourceTestMixin):
    initial_status = "active.tendering"
    test_bids_data = test_bids
    author_data = test_author

    def setUp(self):
        super(TenderBidDocumentResourceTest, self).setUp()

        bid_data = deepcopy(self.test_bids_data[0])
        bid_data["value"] = {"amount": 500}
        # Create bid
        response = self.app.post_json(
            "/tenders/{}/bids".format(self.tender_id),
            {"data": bid_data},
        )
        bid = response.json["data"]
        self.bid_id = bid["id"]
        self.bid_token = response.json["access"]["token"]

    test_not_found = snitch(not_found)

    def test_create_tender_bidder_document_nopending(self):
        bid_data = deepcopy(self.test_bids_data[0])
        bid_data["value"] = {"amount": 500}

        response = self.app.post_json(
            "/tenders/{}/bids".format(self.tender_id),
            {"data": bid_data},
        )
        bid = response.json["data"]
        bid_id = bid["id"]
        bid_token = response.json["access"]["token"]

        response = self.app.post(
            "/tenders/{}/bids/{}/documents?acc_token={}".format(
                self.tender_id, bid_id, bid_token),
            upload_files=[("file", "name.doc", "content")],
        )
        self.assertEqual(response.status, "201 Created")
        self.assertEqual(response.content_type, "application/json")
        doc_id = response.json["data"]["id"]
        self.assertIn(doc_id, response.headers["Location"])

        self.set_status("active.qualification")

        response = self.app.patch_json(
            "/tenders/{}/bids/{}/documents/{}?acc_token={}".format(
                self.tender_id, bid_id, doc_id, bid_token),
            {"data": {
                "description": "document description"
            }},
            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 document because award of bid is not in pending or active state",
        )

        response = self.app.put(
            "/tenders/{}/bids/{}/documents/{}?acc_token={}".format(
                self.tender_id, bid_id, doc_id, bid_token),
            "content3",
            content_type="application/msword",
            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 document because award of bid is not in pending or active state",
        )

        response = self.app.post(
            "/tenders/{}/bids/{}/documents?acc_token={}".format(
                self.tender_id, bid_id, bid_token),
            upload_files=[("file", "name.doc", "content")],
            status=403,
        )
        self.assertEqual(response.status, "403 Forbidden")
        self.assertEqual(response.content_type, "application/json")
        self.assertEqual(
            response.json["errors"][0]["description"],
            "Can't add document because award of bid is not in pending or active state",
        )
Esempio n. 20
0
class ClaimPostResourceMixin(object):
    test_create_complaint_post_claim_forbidden = snitch(
        create_complaint_post_claim_forbidden)
class Tender2LotQualificationClaimResourceTest(
        Tender2LotQualificationComplaintResourceTest):
    after_qualification_switch_to = "unsuccessful"

    def setUp(self):
        super(TenderQualificationComplaintResourceTest, self).setUp()

        # update periods to have possibility to change tender status by chronograph
        self.set_status("active.pre-qualification",
                        extra={"status": "active.tendering"})

        # simulate chronograph tick
        auth = self.app.authorization
        self.app.authorization = ("Basic", ("chronograph", ""))
        response = self.app.patch_json("/tenders/{}".format(self.tender_id),
                                       {"data": {
                                           "id": self.tender_id
                                       }})
        self.assertEqual(response.json["data"]["status"],
                         "active.pre-qualification")
        self.app.authorization = auth

        response = self.app.get("/tenders/{}/qualifications".format(
            self.tender_id))
        self.assertEqual(response.content_type, "application/json")
        qualifications = response.json["data"]
        self.qualification_id = qualifications[0]["id"]

        for qualification in qualifications:
            if qualification["bidID"] == self.initial_bids[0]["id"]:
                response = self.app.patch_json(
                    "/tenders/{}/qualifications/{}?acc_token={}".format(
                        self.tender_id, qualification["id"],
                        self.tender_token),
                    {
                        "data": {
                            "status": "active",
                            "qualified": True,
                            "eligible": True
                        }
                    },
                )
                self.assertEqual(response.status, "200 OK")
                self.assertEqual(response.json["data"]["status"], "active")
            else:
                response = self.app.patch_json(
                    "/tenders/{}/qualifications/{}?acc_token={}".format(
                        self.tender_id, qualification["id"],
                        self.tender_token),
                    {"data": {
                        "status": "unsuccessful"
                    }},
                )
                self.assertEqual(response.status, "200 OK")
                self.assertEqual(response.json["data"]["status"],
                                 "unsuccessful")
                self.unsuccessful_qualification_id = qualification["id"]

        response = self.app.patch_json(
            "/tenders/{}?acc_token={}".format(self.tender_id,
                                              self.tender_token),
            {"data": {
                "status": "active.pre-qualification.stand-still"
            }},
        )
        self.assertEqual(response.status, "200 OK")

    test_create_tender_qualification_claim = snitch(
        create_tender_qualification_claim)
Esempio n. 22
0
class ComplaintPostResourceMixin(object):
    test_create_complaint_post_release_forbidden = snitch(
        create_complaint_post_release_forbidden)
    test_create_complaint_post_status_forbidden = snitch(
        create_complaint_post_status_forbidden)
    test_create_complaint_post_review_date_forbidden = snitch(
        create_complaint_post_review_date_forbidden)
    test_create_complaint_post_complaint_owner = snitch(
        create_complaint_post_complaint_owner)
    test_create_complaint_post_tender_owner = snitch(
        create_complaint_post_tender_owner)
    test_create_complaint_post_validate_recipient = snitch(
        create_complaint_post_validate_recipient)
    test_create_complaint_post_validate_related_post = snitch(
        create_complaint_post_validate_related_post)
    test_patch_complaint_post = snitch(patch_complaint_post)
    test_get_complaint_post = snitch(get_complaint_post)
    test_get_complaint_posts = snitch(get_complaint_posts)
    test_get_tender_complaint_post_document_json = snitch(
        get_tender_complaint_post_document_json)
    test_create_tender_complaint_post_document_json = snitch(
        create_tender_complaint_post_document_json)
    test_create_tender_complaint_post_by_complaint_owner_document_json = snitch(
        create_tender_complaint_post_by_complaint_owner_document_json)
    test_create_tender_complaint_post_by_tender_owner_document_json = snitch(
        create_tender_complaint_post_by_tender_owner_document_json)
    test_put_tender_complaint_document_json = snitch(
        put_tender_complaint_document_json)
class TenderIssueCBD1713Test(Tender2LotQualificationResourceTest):
    test_switch_bid_status_unsuccessul_to_active = snitch(
        switch_bid_status_unsuccessul_to_active)
Esempio n. 24
0
class Tender2LotNegotiationAwardComplaintResourceTest(BaseTenderContentWebTest
                                                      ):
    initial_data = test_tender_negotiation_data_2items

    def setUp(self):
        super(Tender2LotNegotiationAwardComplaintResourceTest, self).setUp()
        self.create_award()

    def create_award(self):
        # create lots
        response = self.app.post_json(
            '/tenders/{}/lots?acc_token={}'.format(self.tender_id,
                                                   self.tender_token),
            {'data': test_lots[0]})
        self.assertEqual(response.status, '201 Created')
        self.assertEqual(response.content_type, 'application/json')
        self.first_lot = response.json['data']

        self.assertEqual(response.content_type, 'application/json')
        response = self.app.post_json(
            '/tenders/{}/lots?acc_token={}'.format(self.tender_id,
                                                   self.tender_token),
            {'data': test_lots[0]})
        self.assertEqual(response.status, '201 Created')
        self.second_lot = response.json['data']

        # set items to lot
        response = self.app.patch_json(
            '/tenders/{}?acc_token={}'.format(self.tender_id,
                                              self.tender_token),
            {
                "data": {
                    "items": [{
                        "relatedLot": self.first_lot['id']
                    }, {
                        "relatedLot": self.second_lot['id']
                    }]
                }
            })

        self.assertEqual(response.status, '200 OK')
        self.assertEqual(response.json['data']['items'][0]['relatedLot'],
                         self.first_lot['id'])
        self.assertEqual(response.json['data']['items'][1]['relatedLot'],
                         self.second_lot['id'])

        # create first award
        request_path = '/tenders/{}/awards?acc_token={}'.format(
            self.tender_id, self.tender_token)
        response = self.app.post_json(
            request_path, {
                'data': {
                    'suppliers': [test_organization],
                    'qualified': True,
                    'status': 'pending',
                    'lotID': self.first_lot['id']
                }
            })
        self.assertEqual(response.status, '201 Created')
        self.assertEqual(response.content_type, 'application/json')
        self.first_award = response.json['data']
        self.award_id = self.first_award['id']

        # create second award
        request_path = '/tenders/{}/awards?acc_token={}'.format(
            self.tender_id, self.tender_token)
        response = self.app.post_json(
            request_path, {
                'data': {
                    'suppliers': [test_organization],
                    'qualified': True,
                    'status': 'pending',
                    'lotID': self.second_lot['id']
                }
            })
        self.assertEqual(response.status, '201 Created')
        self.assertEqual(response.content_type, 'application/json')
        self.second_award = response.json['data']
        self.second_award_id = self.second_award['id']

    test_two_awards_on_one_lot = snitch(two_awards_on_one_lot)
    test_change_lotID_from_unsuccessful_award = snitch(
        change_lotID_from_unsuccessful_award)
    test_change_lotID_from_active_award = snitch(
        change_lotID_from_active_award)
    test_change_lotID_from_cancelled_award = snitch(
        change_lotID_from_cancelled_award)
class TenderDocumentWithDSResourceTestMixin(object):
    test_create_tender_document_json_invalid = snitch(create_tender_document_json_invalid)
    test_create_tender_document_json = snitch(create_tender_document_json)
    test_put_tender_document_json = snitch(put_tender_document_json)
Esempio n. 26
0
class TenderQualificationDocumentWithDSResourceTest(
        TenderQualificationDocumentResourceTest):
    docservice = True

    test_create_tender_qualifications_document_json_bulk = snitch(
        create_tender_qualifications_document_json_bulk)
class TenderDocumentWithDSResourceTest(TenderDocumentResourceTest, TenderDocumentWithDSResourceTestMixin):

    docservice = True
    test_create_tender_document_error = snitch(create_tender_document_error)
Esempio n. 28
0
class TenderQualificationComplaintResourceTest(TenderQualificationBaseTestCase
                                               ):
    def setUp(self):
        super(TenderQualificationComplaintResourceTest, self).setUp()

        response = self.app.get("/tenders/{}/qualifications".format(
            self.tender_id))
        self.assertEqual(response.content_type, "application/json")
        qualifications = response.json["data"]
        self.qualification_id = qualifications[0]["id"]

        for qualification in qualifications:
            response = self.app.patch_json(
                "/tenders/{}/qualifications/{}?acc_token={}".format(
                    self.tender_id, qualification["id"], self.tender_token),
                {
                    "data": {
                        "status": "active",
                        "qualified": True,
                        "eligible": True
                    }
                },
            )
            self.assertEqual(response.status, "200 OK")
            self.assertEqual(response.json["data"]["status"], "active")

        response = self.app.patch_json(
            "/tenders/{}?acc_token={}".format(self.tender_id,
                                              self.tender_token),
            {"data": {
                "status": "active.pre-qualification.stand-still"
            }},
        )
        self.assertEqual(response.status, "200 OK")

    test_create_tender_qualification_complaint_invalid = snitch(
        create_tender_qualification_complaint_invalid)
    test_create_tender_qualification_complaint = snitch(
        create_tender_qualification_complaint)
    test_patch_tender_qualification_complaint = snitch(
        patch_tender_qualification_complaint)
    test_review_tender_qualification_complaint = snitch(
        review_tender_qualification_complaint)
    test_review_tender_qualification_stopping_complaint = snitch(
        review_tender_qualification_stopping_complaint)
    test_review_tender_award_claim = snitch(review_tender_award_claim)
    test_get_tender_qualification_complaint = snitch(
        get_tender_qualification_complaint)
    test_get_tender_qualification_complaints = snitch(
        get_tender_qualification_complaints)
    test_change_status_to_standstill_with_complaint = snitch(
        change_status_to_standstill_with_complaint)
    test_bot_patch_tender_qualification_complaint = snitch(
        bot_patch_tender_qualification_complaint)
    test_bot_patch_tender_qualification_complaint_forbidden = snitch(
        bot_patch_tender_qualification_complaint_forbidden)
Esempio n. 29
0
class Tender2LotBidResourceTest(BaseSimpleDefContentWebTest):
    test_bids_data = test_bids
    initial_lots = 2 * test_lots
    initial_status = "active.tendering"

    test_patch_tender_with_bids_lots_none = snitch(patch_tender_with_bids_lots_none)
class TenderUAComplaintResourceTestMixin(object):
    test_create_tender_complaint = snitch(create_tender_complaint)
    test_patch_tender_complaint = snitch(patch_tender_complaint)
    test_review_tender_complaint = snitch(review_tender_complaint)
    test_review_tender_stopping_complaint = snitch(review_tender_stopping_complaint)