mirror of https://github.com/zulip/zulip.git
test_docs: Fix unnecessary info-level logging in tests.
This commit is contained in:
parent
e19312b394
commit
ef9679667f
|
@ -1,5 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import mock
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
@ -78,7 +79,8 @@ class DocPageTest(ZulipTestCase):
|
||||||
self._test('/errors/404/', 'Page not found')
|
self._test('/errors/404/', 'Page not found')
|
||||||
self._test('/errors/5xx/', 'Internal server error')
|
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
|
# For reaching full coverage for clear_emails function
|
||||||
result = self.client_get('/emails/clear/')
|
result = self.client_get('/emails/clear/')
|
||||||
self.assertEqual(result.status_code, 302)
|
self.assertEqual(result.status_code, 302)
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import logging
|
||||||
|
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
@ -39,5 +41,5 @@ class EmailLogBackEnd(BaseEmailBackend):
|
||||||
for email in email_messages:
|
for email in email_messages:
|
||||||
self.log_email(email)
|
self.log_email(email)
|
||||||
email_log_url = settings.ROOT_DOMAIN_URI + "/emails"
|
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)
|
return len(email_messages)
|
||||||
|
|
Loading…
Reference in New Issue