mirror of https://github.com/django/django.git
Used @override_settings decorator rather than "with" to reduce indentation.
This commit is contained in:
parent
45c7acdc50
commit
86880ab89b
|
@ -90,20 +90,20 @@ class DefaultLoggingTest(LoggingCaptureMixin, SimpleTestCase):
|
||||||
self.logger.error("Hey, this is an error.")
|
self.logger.error("Hey, this is an error.")
|
||||||
self.assertEqual(self.logger_output.getvalue(), 'Hey, this is an error.\n')
|
self.assertEqual(self.logger_output.getvalue(), 'Hey, this is an error.\n')
|
||||||
|
|
||||||
|
@override_settings(DEBUG=True)
|
||||||
def test_django_logger_warning(self):
|
def test_django_logger_warning(self):
|
||||||
with self.settings(DEBUG=True):
|
self.logger.warning('warning')
|
||||||
self.logger.warning('warning')
|
self.assertEqual(self.logger_output.getvalue(), 'warning\n')
|
||||||
self.assertEqual(self.logger_output.getvalue(), 'warning\n')
|
|
||||||
|
|
||||||
|
@override_settings(DEBUG=True)
|
||||||
def test_django_logger_info(self):
|
def test_django_logger_info(self):
|
||||||
with self.settings(DEBUG=True):
|
self.logger.info('info')
|
||||||
self.logger.info('info')
|
self.assertEqual(self.logger_output.getvalue(), 'info\n')
|
||||||
self.assertEqual(self.logger_output.getvalue(), 'info\n')
|
|
||||||
|
|
||||||
|
@override_settings(DEBUG=True)
|
||||||
def test_django_logger_debug(self):
|
def test_django_logger_debug(self):
|
||||||
with self.settings(DEBUG=True):
|
self.logger.debug('debug')
|
||||||
self.logger.debug('debug')
|
self.assertEqual(self.logger_output.getvalue(), '')
|
||||||
self.assertEqual(self.logger_output.getvalue(), '')
|
|
||||||
|
|
||||||
|
|
||||||
class WarningLoggerTests(SimpleTestCase):
|
class WarningLoggerTests(SimpleTestCase):
|
||||||
|
|
Loading…
Reference in New Issue