Skip to content

Commit

Permalink
Apply renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
fpagnoux committed Aug 28, 2017
1 parent f3a94ea commit ccd0403
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/web_api/test_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_variable_formula_github_link():


def test_variable_formula_content():
formula_code = "def formula(person, period, legislation):\n return person('salary', period) * legislation(period).taxes.income_tax_rate\n"
formula_code = "def formula(person, period, parameters):\n return person('salary', period) * parameters(period).taxes.income_tax_rate\n"
assert_equal(variable['formulas']['0001-01-01']['content'], formula_code)


Expand All @@ -121,8 +121,8 @@ def test_dated_variable_formulas_dates():


def test_dated_variable_formulas_content():
formula_code_2016 = "def formula_2016_12(person, period, legislation):\n age_condition = person('age', period) >= legislation(period).general.age_of_majority\n return age_condition * legislation(period).benefits.basic_income # This '*' is a vectorial 'if'. See https://doc.openfisca.fr/coding-the-legislation/30_case_disjunction.html#simple-multiplication\n"
formula_code_2015 = "def formula_2015_12(person, period, legislation):\n age_condition = person('age', period) >= legislation(period).general.age_of_majority\n salary_condition = person('salary', period) == 0\n return age_condition * salary_condition * legislation(period).benefits.basic_income # The '*' is also used as a vectorial 'and'. See https://doc.openfisca.fr/coding-the-legislation/25_vectorial_computing.html#forbidden-operations-and-alternatives\n"
formula_code_2016 = "def formula_2016_12(person, period, parameters):\n age_condition = person('age', period) >= parameters(period).general.age_of_majority\n return age_condition * parameters(period).benefits.basic_income # This '*' is a vectorial 'if'. See https://doc.openfisca.fr/coding-the-legislation/30_case_disjunction.html#simple-multiplication\n"
formula_code_2015 = "def formula_2015_12(person, period, parameters):\n age_condition = person('age', period) >= parameters(period).general.age_of_majority\n salary_condition = person('salary', period) == 0\n return age_condition * salary_condition * parameters(period).benefits.basic_income # The '*' is also used as a vectorial 'and'. See https://doc.openfisca.fr/coding-the-legislation/25_vectorial_computing.html#forbidden-operations-and-alternatives\n"

assert_equal(dated_variable['formulas']['2016-12-01']['content'], formula_code_2016)
assert_equal(dated_variable['formulas']['2015-12-01']['content'], formula_code_2015)

0 comments on commit ccd0403

Please sign in to comment.