Ejemplo n.º 1
0
def test():
    year = 2015
    max_sal = 18000
    count = 2
    people = 1
    reform = ayrault_muet(tax_benefit_system)
    scenario = reform.new_scenario().init_single_entity(
        axes=[
            dict(
                count=count,
                max=max_sal,
                min=0,
                name='salaire_imposable',
            ),
        ],
        period=periods.period(year),
        parent1=dict(date_naissance=datetime.date(year - 40, 1, 1)),
        parent2=dict(
            date_naissance=datetime.date(year -
                                         40, 1, 1)) if people >= 2 else None,
        enfants=[
            dict(date_naissance=datetime.date(year - 9, 1, 1))
            if people >= 3 else None,
            dict(date_naissance=datetime.date(year - 9, 1, 1))
            if people >= 4 else None,
        ] if people >= 3 else None,
    )

    reference_simulation = scenario.new_simulation(use_baseline=True)
    reform_simulation = scenario.new_simulation()

    impots_directs = reference_simulation.calculate('impots_directs',
                                                    period=year)  # noqa F841
    reform_impots_directs = reform_simulation.calculate(
        'impots_directs', period=year)  # noqa F841
def test():
    year = 2015
    max_sal = 18000
    count = 2
    people = 1
    reform = ayrault_muet(tax_benefit_system)
    scenario = reform.new_scenario().init_single_entity(
        axes = [
            dict(
                count = count,
                max = max_sal,
                min = 0,
                name = 'salaire_imposable',
                ),
            ],
        period = periods.period(year),
        parent1 = dict(date_naissance = datetime.date(year - 40, 1, 1)),
        parent2 = dict(date_naissance = datetime.date(year - 40, 1, 1)) if people >= 2 else None,
        enfants = [
            dict(date_naissance = datetime.date(year - 9, 1, 1)) if people >= 3 else None,
            dict(date_naissance = datetime.date(year - 9, 1, 1)) if people >= 4 else None,
            ] if people >= 3 else None,
        )

    reference_simulation = scenario.new_simulation(use_baseline = True)
    reform_simulation = scenario.new_simulation()

    impots_directs = reference_simulation.calculate('impots_directs', period = year) # noqa F841
    reform_impots_directs = reform_simulation.calculate('impots_directs', period = year) # noqa F841
    def _simulations(year: int) -> Tuple[Simulation]:
        scenario = new_scenario(
            reform = ayrault_muet(tax_benefit_system),
            count = 2,
            _max = 18000,
            _min = 0,
            name = "salaire_imposable",
            year = year,
            people = 1,
            )

        return scenario.new_simulation(use_baseline = True), scenario.new_simulation()