-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Corrige les erreurs de calcul sur les allègements #862
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d0552bc
Add failing tests
Anna-Livia 8124859
Add failing test for coefficient_proratisation
Morendil 1a6d5bd
Clarify test
Morendil 8ef9969
Make coefficient test pass
Morendil 389bd37
Fix test to avoid weird period handling
Morendil 1287fcf
Some test tweaks
Morendil b842e96
Fix coefficient test
Morendil e26b958
Fix evaluation date & test period
Morendil 43de39a
Fix YAML contract end date correcting off-by-1-day
Morendil 91acf12
Fix timing for allegement in november/anticipe case
Morendil fc3af5e
Distinguish narrow and wide cases
Morendil 0990ff9
Use request_last_or_next for contrat de travail
Morendil 21b03a3
Avoid division by zero by not computing a ratio
Morendil 5a5704c
Update Changelog and bump version
Morendil 5e2c44f
Répare des enums dans les tests
Anna-Livia 3e4e58c
Fix whitespace
Morendil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from nose.tools import assert_equal | ||
|
||
from openfisca_france.model.prelevements_obligatoires.prelevements_sociaux.cotisations_sociales.allegements import * | ||
from openfisca_core.periods import * | ||
from openfisca_france import FranceTaxBenefitSystem | ||
|
||
def test_coefficient_proratisation_only_contract_periods_wide(): | ||
tax_benefit_system = FranceTaxBenefitSystem() | ||
scenario = tax_benefit_system.new_scenario() | ||
scenario.init_single_entity(period='2017', # wide: we simulate for the year | ||
parent1=dict(salaire_de_base={'2017-11':2300}, | ||
effectif_entreprise=1, | ||
code_postal_entreprise="75001", | ||
categorie_salarie=u'prive_non_cadre', | ||
contrat_de_travail_debut='2017-11-1', | ||
contrat_de_travail_fin='2017-12-01', | ||
allegement_fillon_mode_recouvrement=u'progressif')) | ||
simulation = scenario.new_simulation() | ||
assert_equal(simulation.calculate('coefficient_proratisation','2017-11'),1) | ||
assert_equal(simulation.calculate('coefficient_proratisation','2017-12'),0) | ||
assert_equal(simulation.calculate('coefficient_proratisation','2017-10'),0) | ||
assert_equal(simulation.calculate_add('coefficient_proratisation','2017'),1) | ||
|
||
def test_coefficient_proratisation_only_contract_periods_narrow(): | ||
tax_benefit_system = FranceTaxBenefitSystem() | ||
scenario = tax_benefit_system.new_scenario() | ||
scenario.init_single_entity(period='2017-11', # narrow: we simulate for the month | ||
parent1=dict(salaire_de_base={'2017-11':2300}, | ||
effectif_entreprise=1, | ||
code_postal_entreprise="75001", | ||
categorie_salarie=u'prive_non_cadre', | ||
contrat_de_travail_debut='2017-11-1', | ||
contrat_de_travail_fin='2017-12-01', | ||
allegement_fillon_mode_recouvrement=u'progressif')) | ||
simulation = scenario.new_simulation() | ||
assert_equal(simulation.calculate('coefficient_proratisation','2017-11'),1) | ||
assert_equal(simulation.calculate('coefficient_proratisation','2017-12'),0) | ||
assert_equal(simulation.calculate('coefficient_proratisation','2017-10'),0) | ||
assert_equal(simulation.calculate_add('coefficient_proratisation','2017'),1) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bien vu !