#NEWLINE# def test_redirect_to_version( self ) : #NEWLINE# #INDENT# original_request_class = response . app . RequestClass #NEWLINE# try : #NEWLINE# #INDENT# self . app . RequestClass = TestRequest #NEWLINE# response = self . app . get ( '/' ) #NEWLINE# self . assertEqual ( response . status_int , 307 ) #NEWLINE# self . assertEqual ( response . location , ( 'http://localhost/%s/' % API_VERSION ) ) #NEWLINE# response = self . app . get ( '/fields' ) #NEWLINE# self . assertEqual ( response . status_int , 307 ) #NEWLINE# self . assertEqual ( response . location , ( 'http://localhost/%s/fields' % API_VERSION ) ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# self . app . RequestClass = original_request_class