Esempio n. 1
0
def test():
    year = 2013
    reform = landais_piketty_saez(tax_benefit_system)
    scenario = init_single_entity(reform.new_scenario(),
        axes = [[
            dict(
                count = 3,
                max = 30000,
                min = 0,
                name = 'salaire_de_base',
                ),
            ]],
        period = periods.period(year),
        parent1 = dict(date_naissance = datetime.date(year - 40, 1, 1)),
        # parent2 = dict(date_naissance = datetime.date(year - 40, 1, 1)),
        # enfants = [
        #     dict(date_naissance = datetime.date(year - 9, 1, 1)),
        #     dict(date_naissance = datetime.date(year - 9, 1, 1)),
        #     ],
        )

#    reference_simulation = scenario.new_simulation(use_baseline = True)
#
    reform_simulation = scenario.new_simulation()
    reform_assiette_csg = reform_simulation.calculate('assiette_csg', period = year)
    reform_impot_revenu_lps = reform_simulation.calculate('impot_revenu_lps', period = year)
    assert_near(
        -reform_impot_revenu_lps,
        ((reform_assiette_csg - 10000) * .25 / 30000 + .25) * reform_assiette_csg,
        absolute_error_margin = 0.01,
        )
    reform_simulation.calculate('revenu_disponible', period = year)
def test():
    year = 2013
    reform = landais_piketty_saez(tax_benefit_system)
    scenario = reform.new_scenario().init_single_entity(
        axes = [
            dict(
                count = 3,
                max = 30000,
                min = 0,
                name = 'salaire_de_base',
                ),
            ],
        period = periods.period('year', year),
        parent1 = dict(date_naissance = datetime.date(year - 40, 1, 1)),
        # parent2 = dict(date_naissance = datetime.date(year - 40, 1, 1)),
        # enfants = [
        #     dict(date_naissance = datetime.date(year - 9, 1, 1)),
        #     dict(date_naissance = datetime.date(year - 9, 1, 1)),
        #     ],
        )

#    reference_simulation = scenario.new_simulation(reference = True)
#

    reform_simulation = scenario.new_simulation()
    reform_assiette_csg = reform_simulation.calculate('assiette_csg')
    reform_impot_revenu_lps = reform_simulation.calculate('impot_revenu_lps')
    assert_near(
        -reform_impot_revenu_lps,
        ((reform_assiette_csg - 10000) * .25 / 30000 + .25) * reform_assiette_csg,
        absolute_error_margin = 0.01,
        )
Esempio n. 3
0
    period=2015,
    parent1=dict(
        age=30,
        salaire_de_base=20000,
    ),
    enfants=[
        dict(age=12),
        dict(age=18),
    ],
)

simulation = scenario.new_simulation()
print(simulation.calculate('af', '2015-01'))

#New reform from pour une révolution fiscale
reform = landais_piketty_saez.landais_piketty_saez(legislation_france)


def init_profile(scenario):
    scenario.init_single_entity(
        period='2013',
        parent1=dict(
            age=40,
            salaire_de_base=50000,
        ),
    )
    return scenario


# Indicate that you want to perfom the reform on this scenario
reform_scenario = init_profile(reform.new_scenario())