def should_not_add_auth_credentials_if_none_is_set(self): self.request.credentials = None authprocessor = AuthenticationProcessor() authprocessor.execute(self.chain, self.request, {}) assert not self.request.headers.has_key('authorization')
def should_add_simple_auth_credentials_to_request_headers(self): self.request.credentials = ('user', 'pass', 'simple') authprocessor = AuthenticationProcessor() authprocessor.execute(self.chain, self.request, {}) assert self.request.headers.has_key('authorization') assert "Basic" in self.request.headers['authorization']