#NEWLINE# def test_permissions_delete( self ) : #NEWLINE# #INDENT# self . app . config [ 'BLOGGING_PERMISSIONS' ] = True #NEWLINE# user_id = 'testuser' #NEWLINE# self . _set_identity_loader ( ) #NEWLINE# with self . client : #NEWLINE# #INDENT# response = self . client . post ( '/blog/delete/1/' ) #NEWLINE# self . assertEqual ( response . status_code , 401 ) #NEWLINE# self . login ( response ) #NEWLINE# response = self . client . post ( '/blog/delete/1/' ) #NEWLINE# self . assertEqual ( response . status_code , 302 ) #NEWLINE# self . logout ( ) #NEWLINE# self . login ( user_id , blogger = True ) #NEWLINE# response = self . client . post ( '/blog/delete/1/' , follow_redirects = True ) #NEWLINE# assert ( 'Your post was successfully deleted' in str ( response . data ) ) #NEWLINE# self . assertEquals ( current_user . get_id ( ) , user_id ) #NEWLINE# response = self . client . post ( '/blog/delete/11/' , follow_redirects = True ) #NEWLINE# assert ( 'You do not have the rights to delete this post' in str ( response . data ) )