def test_getUsername_request(self): z = Authz() assert z.getUsername(StubRequest('foo', 'bar')) == 'foo'
def test_getUsername_http(self): z = Authz(useHttpHeader = True) assert z.getUsername(StubHttpAuthRequest('foo', 'bar')) == 'foo'
def test_getUsername_http_missing(self): z = Authz(useHttpHeader = True) assert z.getUsername(StubRequest('foo', 'bar')) == None
def test_getUsername_request(self): z = Authz() assert z.getUsername(StubRequest("foo", "bar")) == "foo"
def test_getUsername_http(self): z = Authz(useHttpHeader=True) assert z.getUsername(StubHttpAuthRequest("foo", "bar")) == "foo"