#NEWLINE# def create_user( is_staff = False , authenticated = True ) : #NEWLINE# #INDENT# '\n    Create and return a user, either the AnonymousUser or a normal Django user,\n    setting the is_staff attribute if appropriate.\n    ' #NEWLINE# if ( not authenticated ) : #NEWLINE# #INDENT# return AnonymousUser ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# user = User ( username = 'testing' , email = 'testing@example.com' , is_staff = is_staff ) #NEWLINE# user . set_password ( 'test' ) #NEWLINE# user . save ( )