'Initial Setup'

def setUp(self):

    if (not self.prepared):
        (self.group, created) = Group.objects.get_or_create(name='test')
        (duser, created) = DjangoUser.objects.get_or_create(username=self.username)
        duser.set_password(self.password)
        duser.save()
        (perspective, created) = Perspective.objects.get_or_create(name='default')
        perspective.set_default_user()
        perspective.save()
        ModuleSetting.set('default_perspective', perspective.id)
        self.contact_type = ContactType(name='test')
        self.contact_type.set_default_user()
        self.contact_type.save()
        self.contact = Contact(name='test', contact_type=self.contact_type)
        self.contact.set_default_user()
        self.contact.save()
        self.stream = MessageStream(name='test')
        self.stream.set_default_user()
        self.stream.save()
        self.message = Message(title='test', body='test', author=self.contact, stream=self.stream)
        self.message.set_default_user()
        self.message.save()
        self.client = Client()
        self.prepared = True
