#NEWLINE# def test_type_remove( self ) : #NEWLINE# #INDENT# 'Remove (un-assign) permissions from a user or group.' #NEWLINE# AppPermission . objects . assign ( 'rubberstamp.manage.rubberstamp.apppermission' , self . user ) #NEWLINE# self . client . login ( username = 'user' , password = '' ) #NEWLINE# user4 = User . objects . get ( pk = 4 ) #NEWLINE# AppPermission . objects . assign ( 'testapp.use.testapp.testmodel' , user4 ) #NEWLINE# self . assertTrue ( user4 . has_perm ( 'testapp.use.testapp.testmodel' ) ) #NEWLINE# rp = self . client . post ( '/testapp.use.testapp.testmodel/' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( rp . status_code , 200 ) #NEWLINE# assign_form = rp . context [ 'assign_form' ] #NEWLINE# self . assertTrue ( assign_form . is_valid ( ) ) #NEWLINE# user4 = User . objects . get ( pk = 4 ) #NEWLINE# self . assertFalse ( user4 . has_perm ( 'testapp.use.testapp.testmodel' ) ) #NEWLINE# user5 = User . objects . get ( pk = 5 ) #NEWLINE# group = Group . objects . get ( pk = 1 ) #NEWLINE# AppPermission . objects . assign ( 'testapp.use.testapp.testmodel' , group ) #NEWLINE# user5 . groups . add ( group ) #NEWLINE# self . assertTrue ( user5 . has_perm ( 'testapp.use.testapp.testmodel' ) ) #NEWLINE# rp = self . client . post ( '/testapp.use.testapp.testmodel/' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# user5 = User . objects . get ( pk = 5 ) #NEWLINE# self . assertFalse ( user5 . has_perm ( 'testapp.use.testapp.testmodel' ) )