mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #26504 -- Avoided logging "Not Found" warnings if a middleware handles the 404.
For example, this avoids a warning in the case of a request that's redirected to a language-prefixed URL by LocaleMiddleware.
This commit is contained in:
@@ -133,6 +133,11 @@ class HandlerLoggingTests(SetupDefaultLoggingMixin, LoggingCaptureMixin, SimpleT
|
||||
)
|
||||
class I18nLoggingTests(SetupDefaultLoggingMixin, LoggingCaptureMixin, SimpleTestCase):
|
||||
|
||||
def test_i18n_page_found_no_warning(self):
|
||||
self.client.get('/exists/')
|
||||
self.client.get('/en/exists/')
|
||||
self.assertEqual(self.logger_output.getvalue(), '')
|
||||
|
||||
def test_i18n_page_not_found_warning(self):
|
||||
self.client.get('/this_does_not/')
|
||||
self.client.get('/en/nor_this/')
|
||||
|
||||
Reference in New Issue
Block a user