def afterSetUp(self):
   """
     Initialize the ERP5 site.
   """
   self.group = 'shacache'
   ShaCacheMixin.afterSetUp(self)
   ShaSecurityMixin.afterSetUp(self)
Exemple #2
0
  def afterSetUp(self):
    """
      Initialize the ERP5 site.
    """
    self.expected_content_type = 'application/octet-stream'
    self.group = 'shacache'
    ShaCacheMixin.afterSetUp(self)
    ShaSecurityMixin.afterSetUp(self)

    # Define POST headers with Authentication
    self.content_type =  'application/json'
    authentication_string = '%s:%s' % (self.lucas_user, self.lucas_user)
    base64string = base64.encodestring(authentication_string).strip()
    self.header_dict = {'Authorization': 'Basic %s' % base64string,
                        'Content-Type': self.content_type}

    # HTTP Connection properties
    self.host = self.portal.REQUEST.get('SERVER_NAME')
    self.port = self.portal.REQUEST.get('SERVER_PORT')
    self.path = self.shacache.getPath()