#NEWLINE# @ override_settings ( DEBUG_PROPAGATE_EXCEPTIONS = True ) #NEWLINE# def test_poisoned_http_host( self ) : #NEWLINE# #INDENT# "Poisoned HTTP_HOST headers can't be used for reset emails" #NEWLINE# with patch_logger ( 'django.security.DisallowedHost' , 'error' ) as logger_calls : #NEWLINE# #INDENT# response = self . client . post ( '/password_reset/' , { #NEWLINE# #INDENT# 'email' : 'staffmember@example.com' , #NEWLINE# #UNINDENT# } , HTTP_HOST = 'www.example:dr.frankenstein@evil.tld' ) #NEWLINE# self . assertEqual ( response . status_code , 400 ) #NEWLINE# self . assertEqual ( len ( mail . outbox ) , 0 ) #NEWLINE# self . assertEqual ( len ( self ) , 1 )