#NEWLINE# def test_author_cant_delete_attachment_if_no_delete_permission( self ) : #NEWLINE# #INDENT# self . jon . user_permissions . remove ( self . del_permission ) #NEWLINE# self . client . login ( ** self . cred_jon ) #NEWLINE# self . _upload_testfile ( ) #NEWLINE# att = Attachment . objects . first ( ) #NEWLINE# del_url = reverse ( 'attachments:delete' , kwargs = { #NEWLINE# #INDENT# 'attachment_pk' : att . pk , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . client . get ( del_url , follow = True ) #NEWLINE# self . assertEqual ( Attachment . objects . count ( ) , 1 )