#NEWLINE# @ mock . patch ( 'raven.contrib.django.views.is_valid_origin' , mock . Mock ( return_value = False ) ) #NEWLINE# def test_fails_on_invalid_origin( self ) : #NEWLINE# #INDENT# resp = self . client . post ( resp . path , HTTP_ORIGIN = 'http://example.com' ) #NEWLINE# assert ( resp . status_code == 403 )