From 80944d8bc0c72f9e4803cae24b8409f30773d27b Mon Sep 17 00:00:00 2001 From: Atalya Alon Date: Thu, 10 Oct 2024 18:03:39 +0300 Subject: [PATCH] make sure numbers in tests are strings --- tests/test_news_flash_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_news_flash_api.py b/tests/test_news_flash_api.py index 22c4ab45..4c773bb8 100644 --- a/tests/test_news_flash_api.py +++ b/tests/test_news_flash_api.py @@ -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 @@ -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, @@ -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