'Create a realm, portal, and L{HTTPAuthSessionWrapper} to use in the tests.'

def setUp(self):

    self.username = 'foo    bar'
    self.password = 'bar    baz'
    self.avatarContent = 'contents    of    the    avatar    resource    itself'
    self.childName = 'foo-child'
    self.childContent = 'contents    of    the    foo    child    of    the    avatar'
    self.checker = InMemoryUsernamePasswordDatabaseDontUse()
    self.checker.addUser(self.username, self.password)
    self.avatar = Data(self.avatarContent, 'text/plain')
    self.avatar.putChild(self.childName, Data(self.childContent, 'text/plain'))
    self.avatars = {self.username: self.avatar}
    self.realm = Realm(self.avatars.get)
    self.portal = portal.Portal(self.realm, [self.checker])
    self.credentialFactories = []
    self.wrapper = HTTPAuthSessionWrapper(self.portal, self.credentialFactories)
