Skip to content

Commit

Permalink
Merge pull request #2715 from data-for-change/2663-location-qualifica…
Browse files Browse the repository at this point in the history
…tion-bug

make sure numbers in tests are strings
  • Loading branch information
atalyaalon authored Oct 10, 2024
2 parents 6da51b1 + 80944d8 commit 4246c4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_news_flash_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_add_location_qualifiction_history(self, can, current_user, get_current_
with patch("anyway.views.news_flash.api.db", db_mock):
with patch("anyway.app_and_db.db", db_mock):
mock_request = unittest.mock.MagicMock()
values = {"newsflash_location_qualification": "manual", "road_segment_id": 100, "road1": 1}
values = {"newsflash_location_qualification": "manual", "road_segment_id": "100", "road1": "1"}
mock_request.values.get = lambda key: values.get(key)
with patch("anyway.views.news_flash.api.request", mock_request):
id = self.session.query(NewsFlash).all()[0].id
Expand Down Expand Up @@ -135,7 +135,7 @@ def _test_update_news_flash_qualifying_manual_with_location(self):
db_mock = unittest.mock.MagicMock()
db_mock.session = self.session
mock_request = unittest.mock.MagicMock()
values = {"newsflash_location_qualification": "manual", "road_segment_id": 100, "road1": 1}
values = {"newsflash_location_qualification": "manual", "road_segment_id": "100", "road1": "1"}
mock_request.values.get = lambda key: values.get(key)
road_segment = RoadSegments(
segment_id=100,
Expand Down Expand Up @@ -170,7 +170,7 @@ def _test_update_news_flash_qualifying_not_manual_with_location(self):
also a new location
"""
mock_request = unittest.mock.MagicMock()
values = {"newsflash_location_qualification": "rejected", "road_segment_name": "road", "road1": 1}
values = {"newsflash_location_qualification": "rejected", "road_segment_name": "road", "road1": "1"}
mock_request.values.get = lambda key: values.get(key)
with patch("anyway.views.news_flash.api.request", mock_request):
id = self.session.query(NewsFlash).all()[0].id
Expand Down

0 comments on commit 4246c4f

Please sign in to comment.