mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-30 19:43:47 +00:00 
			
		
		
		
	test_push_notifs: Remove gcm_client mock in test_connection_error.
This wasn't doing anything. The test simulates failure to connect to the bouncer, so the codepaths inside the bouncer don't even get triggered.
This commit is contained in:
		
				
					committed by
					
						 Tim Abbott
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							2628af9ef4
						
					
				
				
					commit
					496aa2a0f1
				
			| @@ -3082,14 +3082,8 @@ class HandlePushNotificationTest(PushNotificationTest): | |||||||
|         assert settings.PUSH_NOTIFICATION_BOUNCER_URL is not None |         assert settings.PUSH_NOTIFICATION_BOUNCER_URL is not None | ||||||
|         URL = settings.PUSH_NOTIFICATION_BOUNCER_URL + "/api/v1/remotes/push/notify" |         URL = settings.PUSH_NOTIFICATION_BOUNCER_URL + "/api/v1/remotes/push/notify" | ||||||
|         responses.add(responses.POST, URL, body=ConnectionError()) |         responses.add(responses.POST, URL, body=ConnectionError()) | ||||||
|         with mock.patch("zerver.lib.push_notifications.gcm_client") as mock_gcm: |         with self.assertRaises(PushNotificationBouncerRetryLaterError): | ||||||
|             gcm_devices = [ |             handle_push_notification(self.user_profile.id, missed_message) | ||||||
|                 (b64_to_hex(device.token), device.ios_app_id, device.token) |  | ||||||
|                 for device in RemotePushDeviceToken.objects.filter(kind=PushDeviceToken.FCM) |  | ||||||
|             ] |  | ||||||
|             mock_gcm.json_request.return_value = {"success": {gcm_devices[0][2]: message.id}} |  | ||||||
|             with self.assertRaises(PushNotificationBouncerRetryLaterError): |  | ||||||
|                 handle_push_notification(self.user_profile.id, missed_message) |  | ||||||
|  |  | ||||||
|     @mock.patch("zerver.lib.push_notifications.push_notifications_configured", return_value=True) |     @mock.patch("zerver.lib.push_notifications.push_notifications_configured", return_value=True) | ||||||
|     def test_read_message(self, mock_push_notifications: mock.MagicMock) -> None: |     def test_read_message(self, mock_push_notifications: mock.MagicMock) -> None: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user