#NEWLINE# def test_anon_user_cant_delete( self ) : #NEWLINE# #INDENT# count = Instance . objects . filter ( deleted_at = None ) . count ( ) #NEWLINE# instance = Instance . objects . filter ( xform = self . xform ) . latest ( 'date_created' ) #NEWLINE# params = { #NEWLINE# #INDENT# 'id' : instance . id , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . anon . post ( self . delete_url , params ) #NEWLINE# self . assertEqual ( response . status_code , 302 ) #NEWLINE# self . assertIn ( 'accounts/login/?next=' , response [ 'Location' ] ) #NEWLINE# self . assertEqual ( Instance . objects . filter ( deleted_at = None ) . count ( ) , count )