#NEWLINE# def test_app_list( self ) : #NEWLINE# #INDENT# 'The root view shows a list of apps and the permissions they define.' #NEWLINE# xr = self . client . get ( '/' ) #NEWLINE# self . assertEqual ( xr . status_code , 302 ) #NEWLINE# self . client . login ( username = 'user' , password = '' ) #NEWLINE# xr = self . client . get ( '/' ) #NEWLINE# self . assertEqual ( xr . status_code , 302 ) #NEWLINE# AppPermission . objects . assign ( 'rubberstamp.manage.rubberstamp.apppermission' , self . user ) #NEWLINE# r = self . client . get ( '/' ) #NEWLINE# self . assertEqual ( r . status_code , 200 ) #NEWLINE# ap_ct = ContentType . objects . get ( app_label = 'rubberstamp' , model = 'apppermission' ) #NEWLINE# tm_ct = ContentType . objects . get ( app_label = 'testapp' , model = 'testmodel' ) #NEWLINE# otm_ct = ContentType . objects . get ( app_label = 'testapp' , model = 'othertestmodel' ) #NEWLINE# apps = [ { #NEWLINE# #INDENT# 'label' : 'rubberstamp' , #NEWLINE# 'perms' : [ { #NEWLINE# #INDENT# 'codename' : 'manage' , #NEWLINE# 'types' : [ ap_ct ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'label' : 'testapp' , #NEWLINE# 'perms' : [ { #NEWLINE# #INDENT# 'codename' : 'have' , #NEWLINE# 'types' : [ tm_ct ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'codename' : 'use' , #NEWLINE# 'types' : [ otm_ct , tm_ct ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } ] #NEWLINE# self . assertEqual ( repr ( r . context [ 'apps' ] ) , repr ( apps ) )