#NEWLINE# def test_permissionif_tag( self ) : #NEWLINE# #INDENT# user = create_user ( 'permission_templatetag_test_user1' ) #NEWLINE# perm = create_permission ( 'permission_templatetag_test_perm1' ) #NEWLINE# user . user_permissions . add ( perm ) #NEWLINE# self . assertTrue ( user . has_perm ( 'permission.permission_templatetag_test_perm1' ) ) #NEWLINE# context = Context ( { #NEWLINE# #INDENT# 'user' : user , #NEWLINE# #UNINDENT# } ) #NEWLINE# out = Template ( "{% permission user has 'permission.permission_templatetag_test_perm1' %}Success{% else %}Fail{% endpermission %}" ) . render ( user ) #NEWLINE# self . assertEqual ( out , 'Success' )