#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# 'Initial Setup' #NEWLINE# if ( not self . prepared ) : #NEWLINE# #INDENT# Object . objects . all ( ) . delete ( ) #NEWLINE# try : #NEWLINE# #INDENT# self . group = Group . objects . get ( name = 'test' ) #NEWLINE# #UNINDENT# except Group . DoesNotExist : #NEWLINE# #INDENT# Group . objects . all ( ) . delete ( ) #NEWLINE# self . group = Group ( name = 'test' ) #NEWLINE# self . group . save ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . user = DjangoUser . objects . get ( username = self . username ) #NEWLINE# self . user . set_password ( self . password ) #NEWLINE# try : #NEWLINE# #INDENT# self . profile = self . user . profile #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# User . objects . all ( ) . delete ( ) #NEWLINE# self . user = DjangoUser ( username = self . username , password = '' ) #NEWLINE# self . user . set_password ( self . password ) #NEWLINE# self . user . save ( ) #NEWLINE# #UNINDENT# #UNINDENT# except DjangoUser . DoesNotExist : #NEWLINE# #INDENT# User . objects . all ( ) . delete ( ) #NEWLINE# self . user = DjangoUser ( username = self . username , password = '' ) #NEWLINE# self . user . set_password ( self . password ) #NEWLINE# self . user . save ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# perspective = Perspective . objects . get ( name = 'default' ) #NEWLINE# #UNINDENT# except Perspective . DoesNotExist : #NEWLINE# #INDENT# Perspective . objects . all ( ) . delete ( ) #NEWLINE# perspective = Perspective ( name = 'default' ) #NEWLINE# perspective . set_default_user ( ) #NEWLINE# perspective . save ( ) #NEWLINE# #UNINDENT# ModuleSetting . set ( 'default_perspective' , perspective . id ) #NEWLINE# self . contact_type = ContactType ( name = 'test' ) #NEWLINE# self . contact_type . set_default_user ( ) #NEWLINE# self . contact_type . save ( ) #NEWLINE# self . contact = Contact ( name = 'test' , contact_type = self . contact_type ) #NEWLINE# self . contact . set_default_user ( ) #NEWLINE# self . contact . save ( ) #NEWLINE# self . user_contact = Contact ( name = 'test' , related_user = self . user . profile , contact_type = self . contact_type ) #NEWLINE# self . user_contact . set_user ( self . user . profile ) #NEWLINE# self . user_contact . save ( ) #NEWLINE# self . stream = MessageStream ( name = 'test' ) #NEWLINE# self . stream . set_default_user ( ) #NEWLINE# self . stream . save ( ) #NEWLINE# self . mlist = MailingList ( name = 'test' , from_contact = self . contact ) #NEWLINE# self . mlist . set_default_user ( ) #NEWLINE# self . mlist . save ( ) #NEWLINE# self . message = Message ( title = 'test' , body = 'test' , author = self . contact , stream = perspective . stream ) #NEWLINE# self . message . set_default_user ( ) #NEWLINE# self . message . save ( ) #NEWLINE# self . client = Client ( ) #NEWLINE# self . prepared = True