#NEWLINE# def test_bad_auth( self ) : #NEWLINE# #INDENT# r = Role . query . filter_by ( name = 'User' ) . first ( ) #NEWLINE# self . assertIsNotNone ( r ) #NEWLINE# u = User ( email = 'john@example.com' , password = 'cat' , confirmed = True , role = r ) #NEWLINE# db . session . add ( u ) #NEWLINE# db . session . commit ( ) #NEWLINE# response = self . client . get ( url_for ( 'api.get_posts' ) , headers = self . get_api_headers ( 'john@example.com' , 'dog' ) ) #NEWLINE# self . assertTrue ( ( response . status_code == 401 ) )