-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the question from Multnomah violations and make them all Needs…
… More Analysis
- Loading branch information
Showing
5 changed files
with
93 additions
and
91 deletions.
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
33 changes: 33 additions & 0 deletions
33
src/backend/expungeservice/models/charge_types/possible_traffic_violation.py
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,33 @@ | ||
from dataclasses import dataclass | ||
|
||
from expungeservice.models.charge import ChargeType | ||
from expungeservice.models.charge import ChargeUtil | ||
from expungeservice.models.expungement_result import TypeEligibility, EligibilityStatus | ||
|
||
|
||
@dataclass(frozen=True) | ||
class PossibleTrafficViolation(ChargeType): | ||
type_name: str = "Possible Traffic Violation" | ||
expungement_rules: str = """Violations and misdemeanors reduced to violations in Multnomah County may be considered traffic violations that have insufficient identifying information in OECI. Traffic violation convictions are ineligible under 137.225(7)(a). Other violation or reduced-to-violation convictions are generally eligible however, and if this charge is not traffic-related then the user should Enable Editing to update the charge type to Violation or ReducedToViolation.""" | ||
blocks_other_charges: bool = False | ||
severity_level: str = "Violation" | ||
|
||
def type_eligibility(self, disposition): | ||
if ChargeUtil.dismissed(disposition): | ||
return TypeEligibility( | ||
EligibilityStatus.NEEDS_MORE_ANALYSIS, | ||
reason="Dismissed violations are eligible under 137.225(1)(b) but administrative reasons may make this difficult to expunge.", | ||
) | ||
elif ChargeUtil.convicted(disposition): | ||
return TypeEligibility( | ||
EligibilityStatus.NEEDS_MORE_ANALYSIS, | ||
reason="Either ineligible under 137.225(7)(a) or eligible under 137.225(5)(c)" | ||
) | ||
else: | ||
return TypeEligibility( | ||
EligibilityStatus.NEEDS_MORE_ANALYSIS, | ||
reason="A possibly-traffic-related violation with indeterminate disposition needs more information to determine eligibility.", | ||
) | ||
|
||
def hidden_in_record_summary(self, disposition): | ||
return False |
56 changes: 56 additions & 0 deletions
56
src/backend/tests/models/charge_types/test_possible_traffic_violation.py
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,56 @@ | ||
from expungeservice.models.expungement_result import EligibilityStatus | ||
from expungeservice.models.charge_types.violation import Violation | ||
from expungeservice.record_merger import RecordMerger | ||
from expungeservice.models.charge_types.traffic_violation import TrafficViolation | ||
from expungeservice.models.charge_types.possible_traffic_violation import PossibleTrafficViolation | ||
|
||
from tests.factories.charge_factory import ChargeFactory | ||
from tests.models.test_charge import Dispositions | ||
|
||
|
||
def test_violation_multnomah_convicted(): | ||
charge = ChargeFactory.create( | ||
name="Viol Treatment", | ||
statute="1615662", | ||
level="Violation Unclassified", | ||
disposition=Dispositions.CONVICTED, | ||
location="Multnomah", | ||
) | ||
|
||
assert isinstance(charge.charge_type, PossibleTrafficViolation) | ||
assert charge.type_eligibility.status is EligibilityStatus.NEEDS_MORE_ANALYSIS | ||
assert charge.type_eligibility.reason == "Either ineligible under 137.225(7)(a) or eligible under 137.225(5)(c)" | ||
|
||
|
||
def test_violation_multnomah_dismissed(): | ||
charge = ChargeFactory.create( | ||
name="Misdemeanor Treated as a Violation", | ||
statute="161.566(1)", | ||
level="Violation Class A", | ||
disposition=Dispositions.DISMISSED, | ||
location="Multnomah", | ||
) | ||
|
||
assert isinstance(charge.charge_type, PossibleTrafficViolation) | ||
assert charge.type_eligibility.status is EligibilityStatus.NEEDS_MORE_ANALYSIS | ||
assert ( | ||
charge.type_eligibility.reason | ||
== "Dismissed violations are eligible under 137.225(1)(b) but administrative reasons may make this difficult to expunge." | ||
) | ||
|
||
|
||
def test_violation_multnomah_unrecognized_disposition(): | ||
charge = ChargeFactory.create( | ||
name="(Reduced - DA Elected)", | ||
statute="164045", | ||
level="Violation Class A", | ||
disposition=Dispositions.UNRECOGNIZED_DISPOSITION, | ||
location="Multnomah", | ||
) | ||
|
||
assert isinstance(charge.charge_type, PossibleTrafficViolation) | ||
assert charge.type_eligibility.status is EligibilityStatus.NEEDS_MORE_ANALYSIS | ||
assert ( | ||
charge.type_eligibility.reason | ||
== "A possibly-traffic-related violation with indeterminate disposition needs more information to determine eligibility." | ||
) |
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