'Initial Setup'

def setUp(self):

    if (not self.prepared):
        Object.objects.all().delete()
        (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()
        (self.user, created) = User.objects.get_or_create(user=duser)
        self.user.save()
        (perspective, created) = Perspective.objects.get_or_create(name='default')
        perspective.set_default_user()
        perspective.save()
        ModuleSetting.set('default_perspective', perspective.id)
        self.folder = Folder(name='test')
        self.folder.set_default_user()
        self.folder.save()
        self.document = Document(title='test_document', folder=self.folder)
        self.document.set_default_user()
        self.document.save()
        self.file = File(name='test_file', folder=self.folder)
        self.file.set_default_user()
        self.file.save()
        self.link = WebLink(title='test', folder=self.folder, url='test')
        self.link.set_default_user()
        self.link.save()
        self.client = Client()
        self.prepared = True
