class LotDocumentWithDSResourceTest(LotContentWebTest): docservice = True document_types = LOT_DOCUMENT_TYPES initial_status = 'composing' test_01_not_found = snitch(not_found) test_02_create_document_in_forbidden_resource_status = snitch( create_document_in_forbidden_resource_status) test_03_put_resource_document_invalid = snitch( put_resource_document_invalid) test_04_patch_resource_document = snitch(patch_resource_document) test_05_create_resource_document_error = snitch( create_resource_document_error) test_06_create_resource_document_json_invalid = snitch( create_resource_document_json_invalid) test_07_create_resource_document_json = snitch( create_resource_document_json) test_08_put_resource_document_json = snitch(put_resource_document_json) test_09_model_validation = snitch(model_validation) test_10_rectificationPeriod_document_workflow = snitch( rectificationPeriod_document_workflow) # status, in which operations with lot documents (adding, updating) are forbidden forbidden_document_modification_actions_status = 'active.salable' def setUp(self): super(LotDocumentWithDSResourceTest, self).setUp() self.initial_document_data = deepcopy(test_loki_document_data) self.initial_document_data['url'] = self.generate_docservice_url()
class ExtractCredentialsMixin(object): """ Mixin with tests for extract_credentials entry point """ valid_user = '******' test_get_extract_credentials = snitch(get_extract_credentials) test_forbidden_users = snitch(forbidden_users)
class LotItemResourceTest(LotContentWebTest): initial_item_data = deepcopy(test_loki_item_data) test_create_item_resource = snitch(create_item_resource) test_patch_item_resource = snitch(patch_item) test_list_item_resource = snitch(list_item_resource) test_update_items_in_forbidden = snitch(update_items_in_forbidden) test_patch_items_with_lot = snitch(patch_items_with_lot) forbidden_item_statuses_modification = list(set(LOT_STATUSES) - {'draft', 'composing', 'pending'})
class LotAuctionResourceTest(LotContentWebTest): initial_auction_data = deepcopy(auction_common) initial_status = 'draft' test_patch_auctions_with_lot = snitch(patch_auctions_with_lot) test_patch_auction_by_concierge = snitch(patch_auction_by_concierge) test_patch_auction = snitch(patch_auction) test_procurementMethodDetails_check_with_sandbox = snitch( procurementMethodDetails_check_with_sandbox) test_procurementMethodDetails_check_without_sandbox = snitch( procurementMethodDetails_check_without_sandbox)
class LotAuctionResourceTest(LotContentWebTest): initial_auctions_data = deepcopy(test_lot_auctions_data) test_patch_auctions_with_lot = snitch(patch_auctions_with_lot) test_patch_auction_by_concierge = snitch(patch_auction_by_concierge) test_patch_english_auction = snitch(patch_english_auction) test_patch_second_english_auction = snitch(patch_second_english_auction) test_patch_insider_auction = snitch(patch_insider_auction) test_rectificationPeriod_auction_workflow = snitch( rectificationPeriod_auction_workflow) test_procurementMethodDetails_check_with_sandbox = snitch( procurementMethodDetails_check_with_sandbox) test_procurementMethodDetails_check_without_sandbox = snitch( procurementMethodDetails_check_without_sandbox) submissionMethodDetails_check_without_sandbox = snitch( submissionMethodDetails_check) test_registrationFee_default = snitch(registrationFee_default)
class LotDecisionResourceTest(LotContentWebTest): initial_decision_data = deepcopy(test_decision_data) test_create_decision = snitch(create_decision) test_patch_decision = snitch(patch_decision) test_patch_decisions_with_lot_by_broker = snitch(patch_decisions_with_lot_by_broker) test_patch_decisions_with_lot_by_concierge = snitch(patch_decisions_with_lot_by_concierge) test_rectificationPeriod_decision_workflow = snitch(rectificationPeriod_decision_workflow) test_create_or_patch_decision_in_not_allowed_status = snitch(create_or_patch_decision_in_not_allowed_status) test_create_decisions_with_lot = snitch(create_decisions_with_lot)
class LotOwnershipChangeResourceTest(LotContentWebTest, LotOwnershipChangeTestCaseMixin): # decision that was created from asset can't be updated test_new_owner_can_change = None test_mode_test = snitch(switch_mode) def setUp(self): super(LotOwnershipChangeResourceTest, self).setUp() # needed to work with transfer resource self.resource_name = self.__class__.resource_name self.__class__.resource_name = '' self.not_used_transfer = self.create_transfer() def tearDown(self): super(LotOwnershipChangeResourceTest, self).tearDown() self.__class__.resource_name = self.resource_name def use_transfer(self, transfer, resource_id, origin_transfer): req_data = { "data": { "id": transfer['data']['id'], 'transfer': origin_transfer } } self.app.post_json( '{}/{}/ownership'.format(self.resource_name, resource_id), req_data) response = self.app.get('transfers/{}'.format(transfer['data']['id'])) return response.json def create_transfer(self): response = self.app.post_json('transfers', {"data": {}}) return response.json def get_resource(self, resource_id): response = self.app.get('{}/{}'.format(self.resource_name, resource_id)) return response.json def set_resource_mode(self, resource_id, mode): current_auth = self.app.authorization self.app.authorization = ('Basic', ('administrator', '')) self.app.patch_json('{}/{}'.format(self.resource_name, resource_id), {'data': { 'mode': mode }}) self.app.authorization = current_auth
class LotOwnershipChangeTestCaseMixin(object): first_owner = 'broker' second_owner = 'broker1' test_owner = 'broker1t' invalid_owner = 'broker3' initial_auth = ('Basic', (first_owner, '')) test_change_resource_ownership = snitch(change_resource_ownership) test_resource_location_in_transfer = snitch(resource_location_in_transfer) test_already_applied_transfer = snitch(already_applied_transfer) test_half_applied_transfer = snitch(half_applied_transfer) test_new_owner_can_change = snitch(new_owner_can_change) test_old_owner_cant_change = snitch(old_owner_cant_change) test_broker_not_accreditation_level = snitch( broker_not_accreditation_level) test_level_test_permis = snitch(level_permis) test_mode_test = snitch(switch_mode)
class LotAuctionDocumentWithDSResourceTest(LotContentWebTest): docservice = True document_types = AUCTION_DOCUMENT_TYPES test_not_found = snitch(not_found_auction_document) test_put_auction_document = snitch(put_auction_document) test_create_auction_document = snitch(create_auction_document) test_patch_auction_document = snitch(patch_auction_document) test_model_validation = snitch(model_validation) test_rectification_document_workflow = snitch( rectificationPeriod_document_workflow) # status, in which operations with lot documents (adding, updating) are forbidden forbidden_document_modification_actions_status = 'active.salable' def setUp(self): super(LotAuctionDocumentWithDSResourceTest, self).setUp() self.initial_document_data = deepcopy(test_loki_document_data) self.initial_document_data['documentOf'] = 'auction' self.initial_document_data['url'] = self.generate_docservice_url()
class LotResourceTest(BaseLotWebTest, ResourceTestMixin): initial_status = 'pending' docservice = True lot_model = Lot maxDiff = None test_05_dateModified_resource = snitch(dateModified_resource) test_08_change_draft_lot = snitch(change_draft_lot) test_09_change_pending_lot = snitch(change_pending_lot) test_10_change_active_salable_lot = snitch(change_active_salable_lot) test_change_pending_deleted_lot = snitch(change_pending_deleted_lot) test_11_check_deleted_lot = snitch(change_deleted_lot) test_12_check_pending_dissolution_lot = snitch( change_pending_dissolution_lot) test_13_check_active_salable_lot = snitch(change_active_salable_lot) test_15_check_active_auction_lot = snitch(change_active_auction_lot) test_16_check_active_contracting_lot = snitch( change_active_contracting_lot) test_17_change_dissolved_lot = snitch(change_dissolved_lot) test_18_check_sold_lot = snitch(change_sold_lot) test_21_check_pending_sold_lot = snitch(change_pending_sold_lot) test_22_simple_patch = snitch(simple_patch) test_change_verification_lot = snitch(change_verification_lot) test_check_change_to_verification = snitch(check_change_to_verification) test_change_composing_lot = snitch(change_composing_lot) test_rectificationPeriod_workflow = snitch(rectificationPeriod_workflow) test_auction_autocreation = snitch(auction_autocreation) test_check_auction_status_lot_workflow = snitch( check_auction_status_lot_workflow) test_check_contract_status_workflow = snitch( check_contract_status_workflow) test_adding_platformLegalDetails_doc = snitch( adding_platformLegalDetails_doc)
class LotTest(BaseLotWebTest): initial_data = test_loki_lot_data relative_to = os.path.dirname(__file__) test_simple_add_lot = snitch(simple_add_lot) test_create_lot_check_auctions_registrationFee = snitch( create_lot_check_auctions_registrationFee)
class LotContractResourceTest(LotContentWebTest): initial_contract_data = deepcopy(test_lot_contract_data) test_patch_contracts_by_convoy = snitch(patch_contracts_by_convoy) test_patch_contracts_by_caravan = snitch(patch_contracts_by_caravan) test_patch_contracts_with_lot = snitch(patch_contracts_with_lot)
class LotTest(BaseWebTest): initial_data = test_loki_lot_data relative_to = os.path.dirname(__file__) test_simple_add_lot = snitch(simple_add_lot)
class LotItemResourceTest(LotContentWebTest): initial_item_data = deepcopy(test_loki_item_data) test_create_item_resource = snitch(create_item_resource) test_patch_item_resource = snitch(patch_item) test_rectificationPeriod_item_workflow = snitch( rectificationPeriod_item_workflow)
class LotResourceTest(BaseLotWebTest, ResourceTestMixin): initial_status = 'pending' test_08_change_draft_lot = snitch(change_draft_lot) test_09_change_pending_lot = snitch(change_pending_lot) test_10_check_verification_lot = snitch(change_verification_lot) test_11_check_deleted_lot = snitch(change_deleted_lot) test_12_check_pending_dissolution_lot = snitch(change_pending_dissolution_lot) test_13_check_active_salable_lot = snitch(change_active_salable_lot) test_14_check_active_awaiting_lot = snitch(change_active_awaiting_lot) test_15_check_active_auction_lot = snitch(change_active_auction_lot) test_16_change_dissolved_lot = snitch(change_dissolved_lot) test_17_check_sold_lot = snitch(change_sold_lot) test_18_check_lot_assets = snitch(check_lot_assets) test_19_check_lot_lotIdentifier = snitch(check_lotIdentifier) test_20_check_pending_sold_lot = snitch(change_pending_sold_lot) test_21_check_recomposed_lot = snitch(change_recomposed_lot) test_22_change_pending_deleted_lot = snitch(change_pending_deleted_lot)