<commit_before># -*- coding: utf-8 -*-
import os
from copy import deepcopy

from openprocurement.tender.openeu.tests.base import (
    BaseTenderWebTest,
    test_features_tender_data as base_eu_test_features_data,
    test_tender_data as base_eu_test_data,
    test_lots as base_eu_lots,
    test_bids as base_eu_bids,
)

NBU_DISCOUNT_RATE = 0.22

test_tender_data = deepcopy(base_eu_test_data)
test_tender_data['procurementMethodType'] = "esco"
test_tender_data['NBUdiscountRate'] = NBU_DISCOUNT_RATE
test_tender_data['minimalStepPercentage'] = 0.027
test_tender_data['fundingKind'] = 'other'
test_tender_data['yearlyPaymentsPercentageRange'] = 0.8

del test_tender_data['value']
del test_tender_data['minimalStep']

test_features_tender_data = deepcopy(base_eu_test_features_data)
test_features_tender_data['procurementMethodType'] = "esco"
test_features_tender_data['NBUdiscountRate'] = NBU_DISCOUNT_RATE
test_features_tender_data['minimalStepPercentage'] = 0.027
test_features_tender_data['fundingKind'] = 'other'
test_features_tender_data['yearlyPaymentsPercentageRange'] = 0.8

del test_features_tender_data['value']
del test_features_tender_data['minimalStep']

test_lots = deepcopy(base_eu_lots)
del test_lots[0]['value']
del test_lots[0]['minimalStep']
test_lots[0]['minimalStepPercentage'] = 0.025
test_lots[0]['fundingKind'] = 'other'
test_lots[0]['yearlyPaymentsPercentageRange'] = 0.8

test_bids = deepcopy(base_eu_bids)
for bid in test_bids:
    bid['value'] = {'yearlyPayments': 0.9,
                       'annualCostsReduction': 751.5,
                       'contractDuration': 10}


class BaseESCOWebTest(BaseTenderWebTest):
    relative_to = os.path.dirname(__file__)
    initial_data = None
    initial_status = None
    initial_bids = None
    initial_lots = None
    initial_auth = ('Basic', ('broker', ''))
    docservice = False



class BaseESCOContentWebTest(BaseESCOWebTest):
    """ ESCO Content Test """
    initialize_initial_data = True
    initial_data = test_tender_data

    def setUp(self):
        super(BaseESCOContentWebTest, self).setUp()
        if self.initial_data and self.initialize_initial_data:
            self.create_tender()
<commit_msg>Update test bid data<commit_after># -*- coding: utf-8 -*-
import os
from copy import deepcopy

from openprocurement.tender.openeu.tests.base import (
    BaseTenderWebTest,
    test_features_tender_data as base_eu_test_features_data,
    test_tender_data as base_eu_test_data,
    test_lots as base_eu_lots,
    test_bids as base_eu_bids,
)

NBU_DISCOUNT_RATE = 0.22

test_tender_data = deepcopy(base_eu_test_data)
test_tender_data['procurementMethodType'] = "esco"
test_tender_data['NBUdiscountRate'] = NBU_DISCOUNT_RATE
test_tender_data['minimalStepPercentage'] = 0.027
test_tender_data['fundingKind'] = 'other'
test_tender_data['yearlyPaymentsPercentageRange'] = 0.8

del test_tender_data['value']
del test_tender_data['minimalStep']

test_features_tender_data = deepcopy(base_eu_test_features_data)
test_features_tender_data['procurementMethodType'] = "esco"
test_features_tender_data['NBUdiscountRate'] = NBU_DISCOUNT_RATE
test_features_tender_data['minimalStepPercentage'] = 0.027
test_features_tender_data['fundingKind'] = 'other'
test_features_tender_data['yearlyPaymentsPercentageRange'] = 0.8

del test_features_tender_data['value']
del test_features_tender_data['minimalStep']

test_lots = deepcopy(base_eu_lots)
del test_lots[0]['value']
del test_lots[0]['minimalStep']
test_lots[0]['minimalStepPercentage'] = 0.025
test_lots[0]['fundingKind'] = 'other'
test_lots[0]['yearlyPaymentsPercentageRange'] = 0.8

test_bids = deepcopy(base_eu_bids)
for bid in test_bids:
    bid['value'] = {'yearlyPaymentsPercentage': 0.9,
                    'annualCostsReduction': [100] * 21,
                    'contractDuration': {'years': 10, 'days': 10}
                    }


class BaseESCOWebTest(BaseTenderWebTest):
    relative_to = os.path.dirname(__file__)
    initial_data = None
    initial_status = None
    initial_bids = None
    initial_lots = None
    initial_auth = ('Basic', ('broker', ''))
    docservice = False



class BaseESCOContentWebTest(BaseESCOWebTest):
    """ ESCO Content Test """
    initialize_initial_data = True
    initial_data = test_tender_data

    def setUp(self):
        super(BaseESCOContentWebTest, self).setUp()
        if self.initial_data and self.initialize_initial_data:
            self.create_tender()

{'fraction_non_alphanumeric': 0.10392245266005411, 'fraction_numerical': 0.016456266907123533, 'mean_word_length': 5.421128798842258, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5989165', 'n_tokens_mistral': 1612, 'n_tokens_neox': 1543, 'n_words': 245}