Skip to content

Commit

Permalink
Merge pull request #2649 from ziv17/2596-fix-set-critical
Browse files Browse the repository at this point in the history
Fixed NewsFlash.set_critical()
  • Loading branch information
ziv17 authored May 14, 2024
2 parents 8a94090 + 51c45f2 commit bdee997
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion anyway/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ def set_critical(
resolution = BE_CONST.ResolutionCategories(self.resolution)
end_time = last_accident_date.to_pydatetime().date()
start_time = datetime.date(end_time.year + 1 - years_before, 1, 1)
location_info = LocationInfo()
location_info: LocationInfo = {}
if resolution == BE_CONST.ResolutionCategories.SUBURBAN_ROAD:
location_info["road1"] = self.road1
location_info["road_segment_id"] = self.road_segment_id
Expand Down
1 change: 1 addition & 0 deletions tests/test_news_flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def test_twitter_parse():
for k in raw_fields:
assert getattr(actual, k) == getattr(expected, k)

actual.set_critical()
actual.accident = classify_tweets(actual.description)
assert actual.accident == expected.accident

Expand Down

0 comments on commit bdee997

Please sign in to comment.