Skip to content

Commit 4246c4f

Browse files
authored
Merge pull request #2715 from data-for-change/2663-location-qualification-bug
make sure numbers in tests are strings
2 parents 6da51b1 + 80944d8 commit 4246c4f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_news_flash_api.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_add_location_qualifiction_history(self, can, current_user, get_current_
9393
with patch("anyway.views.news_flash.api.db", db_mock):
9494
with patch("anyway.app_and_db.db", db_mock):
9595
mock_request = unittest.mock.MagicMock()
96-
values = {"newsflash_location_qualification": "manual", "road_segment_id": 100, "road1": 1}
96+
values = {"newsflash_location_qualification": "manual", "road_segment_id": "100", "road1": "1"}
9797
mock_request.values.get = lambda key: values.get(key)
9898
with patch("anyway.views.news_flash.api.request", mock_request):
9999
id = self.session.query(NewsFlash).all()[0].id
@@ -135,7 +135,7 @@ def _test_update_news_flash_qualifying_manual_with_location(self):
135135
db_mock = unittest.mock.MagicMock()
136136
db_mock.session = self.session
137137
mock_request = unittest.mock.MagicMock()
138-
values = {"newsflash_location_qualification": "manual", "road_segment_id": 100, "road1": 1}
138+
values = {"newsflash_location_qualification": "manual", "road_segment_id": "100", "road1": "1"}
139139
mock_request.values.get = lambda key: values.get(key)
140140
road_segment = RoadSegments(
141141
segment_id=100,
@@ -170,7 +170,7 @@ def _test_update_news_flash_qualifying_not_manual_with_location(self):
170170
also a new location
171171
"""
172172
mock_request = unittest.mock.MagicMock()
173-
values = {"newsflash_location_qualification": "rejected", "road_segment_name": "road", "road1": 1}
173+
values = {"newsflash_location_qualification": "rejected", "road_segment_name": "road", "road1": "1"}
174174
mock_request.values.get = lambda key: values.get(key)
175175
with patch("anyway.views.news_flash.api.request", mock_request):
176176
id = self.session.query(NewsFlash).all()[0].id

0 commit comments

Comments
 (0)