From ccd04032fea8f87540ab40fcc189740bd865dd37 Mon Sep 17 00:00:00 2001 From: Florian Pagnoux Date: Mon, 28 Aug 2017 21:07:35 +0200 Subject: [PATCH] Apply renaming --- tests/web_api/test_variables.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/web_api/test_variables.py b/tests/web_api/test_variables.py index 83b074a4ae..d3720061bc 100644 --- a/tests/web_api/test_variables.py +++ b/tests/web_api/test_variables.py @@ -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) @@ -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)