mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	test_docs: Fix unnecessary info-level logging in tests.
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
# -*- coding: utf-8 -*-
 | 
			
		||||
 | 
			
		||||
import mock
 | 
			
		||||
import os
 | 
			
		||||
import subprocess
 | 
			
		||||
 | 
			
		||||
@@ -78,7 +79,8 @@ class DocPageTest(ZulipTestCase):
 | 
			
		||||
        self._test('/errors/404/', 'Page not found')
 | 
			
		||||
        self._test('/errors/5xx/', 'Internal server error')
 | 
			
		||||
 | 
			
		||||
        with self.settings(EMAIL_BACKEND='zproject.email_backends.EmailLogBackEnd'):
 | 
			
		||||
        with self.settings(EMAIL_BACKEND='zproject.email_backends.EmailLogBackEnd'), \
 | 
			
		||||
                mock.patch('logging.info', return_value=None):
 | 
			
		||||
            # For reaching full coverage for clear_emails function
 | 
			
		||||
            result = self.client_get('/emails/clear/')
 | 
			
		||||
            self.assertEqual(result.status_code, 302)
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,5 @@
 | 
			
		||||
import logging
 | 
			
		||||
 | 
			
		||||
from typing import List
 | 
			
		||||
 | 
			
		||||
from django.conf import settings
 | 
			
		||||
@@ -39,5 +41,5 @@ class EmailLogBackEnd(BaseEmailBackend):
 | 
			
		||||
        for email in email_messages:
 | 
			
		||||
            self.log_email(email)
 | 
			
		||||
            email_log_url = settings.ROOT_DOMAIN_URI + "/emails"
 | 
			
		||||
            print("You can access all the emails sent in development environment by visiting ", email_log_url)
 | 
			
		||||
            logging.info("Emails sent in development are available at ", email_log_url)
 | 
			
		||||
        return len(email_messages)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user