Skip to content

Commit

Permalink
make sure numbers in tests are strings
Browse files Browse the repository at this point in the history
  • Loading branch information
atalyaalon committed Oct 10, 2024
1 parent d587ae8 commit 80944d8
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 @@ -90,7 +90,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 @@ -132,7 +132,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 @@ -167,7 +167,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 80944d8

Please sign in to comment.