def test_contribution_frais_creche():
    year = 2011
    month = '2011-01'
    simulation = init_single_entity(
        base.tax_benefit_system.new_scenario(),
        period = year,
        parent1 = dict(age = 40),
        parent2 = dict(
            date_naissance = datetime.date(1972, 1, 1),
            ),
        enfants = [
            dict(
                # id = 'Behija',
                date_naissance = '1992-01-01',
                ),
            dict(
                # id = 'Hassen',
                date_naissance = '2002-01-01',
                ),
            dict(
                # id = 'Thoura',
                date_naissance = '2008-12-31',
                )
            ]
        ).new_simulation(debug = True)

    ages_en_mois = simulation.menage.members('age_en_mois', period = month)
    age_benjamin = simulation.menage.min(ages_en_mois)[0]
    assert age_benjamin == 24
    assert age_benjamin <= base.tax_benefit_system.parameters(year).prestations_familiales.creche.age_max

    contribution_frais_creche = simulation.calculate('contribution_frais_creche', period = year)
    log.debug(contribution_frais_creche)
    assert contribution_frais_creche != 0
Beispiel #2
0
def test_contribution_frais_creche():
    year = 2011
    month = '2011-01'
    simulation = init_single_entity(
        base.tax_benefit_system.new_scenario(),
        period=year,
        parent1=dict(age=40),
        parent2=dict(date_naissance=datetime.date(1972, 1, 1), ),
        enfants=[
            dict(
                # id = 'Behija',
                date_naissance='1992-01-01', ),
            dict(
                # id = 'Hassen',
                date_naissance='2002-01-01', ),
            dict(
                # id = 'Thoura',
                date_naissance='2008-12-31', )
        ]).new_simulation(debug=True)

    ages_en_mois = simulation.menage.members('age_en_mois', period=month)
    age_benjamin = simulation.menage.min(ages_en_mois)[0]
    assert age_benjamin == 24
    assert age_benjamin <= base.tax_benefit_system.parameters(
        year).prestations_familiales.creche.age_max

    contribution_frais_creche = simulation.calculate(
        'contribution_frais_creche', period=year)
    assert contribution_frais_creche != 0
Beispiel #3
0
def test_basics():
    for scenario_arguments in scenarios_arguments:
        scenario = init_single_entity(base.tax_benefit_system.new_scenario(),
                                      **scenario_arguments)
        simulation = scenario.new_simulation(debug=False)
        period = scenario_arguments['period']
        yield check_run, simulation, period
def test_basics(one_scenario_arguments):
    scenario = init_single_entity(
        tax_benefit_system.new_scenario(),
        **one_scenario_arguments
        )
    simulation = scenario.new_simulation(debug = False)
    period = one_scenario_arguments['period']
    check_run(simulation, period)
Beispiel #5
0
def test_simple():
    year = 2011
    simulation = init_single_entity(
        tax_benefit_system.new_scenario(),
        period = year,
        parent1 = dict(age = 40),
        ).new_simulation(debug = True)
    assert simulation.calculate('revenu_disponible', period = year) == 0
def test_basics():
    for scenario_arguments in scenarios_arguments:
        scenario = init_single_entity(
            base.tax_benefit_system.new_scenario(),
            **scenario_arguments
            )
        simulation = scenario.new_simulation(debug = False)
        period = scenario_arguments['period']
        yield check_run, simulation, period
Beispiel #7
0
def check_1_parent(year=2011):
    scenario = init_single_entity(
        tax_benefit_system.new_scenario(),
        axes=[[dict(
            count=3,
            name='salaire_imposable',
            max=100000,
            min=0,
        )]],
        period=year,
        parent1=dict(date_naissance=datetime.date(year - 40, 1, 1)),
    )
    simulation = scenario.new_simulation()
    revenu_disponible = simulation.calculate('revenu_disponible', period=year)
def check_1_parent(year = 2011):
    scenario = init_single_entity(
        tax_benefit_system.new_scenario(),
        axes = [[
            dict(
                count = 3,
                name = 'salaire_imposable',
                max = 100000,
                min = 0,
                )
            ]],
        period = year,
        parent1 = dict(date_naissance = datetime.date(year - 40, 1, 1)),
        )
    simulation = scenario.new_simulation()
    revenu_disponible = simulation.calculate('revenu_disponible', period = year)
def test_1_parent_axe(period):
    scenario = init_single_entity(
        tax_benefit_system.new_scenario(),
        axes = [[
            dict(
                count = 3,
                name = 'salaire_imposable',
                max = 100000,
                min = 0,
                )
            ]],
        period = period,
        parent1 = dict(date_naissance = datetime.date(period - 40, 1, 1)),
        )
    simulation = scenario.new_simulation()
    assert simulation.calculate('revenu_disponible', period = period) is not None, \
        "Can't compute revenu_disponible on period {}".format(period)
    assert simulation.calculate_add('salaire_super_brut', period = period) is not None, \
        "Can't compute salaire_super_brut on period {}".format(period)