test_docs: Fix unnecessary info-level logging in tests.

This commit is contained in:
Tim Abbott 2017-10-27 15:44:19 -07:00
parent e19312b394
commit ef9679667f
2 changed files with 6 additions and 2 deletions

View File

@ -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)

View File

@ -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)