示例#1
0
 def test_works_if_userid_is_not_in_principals(self):
     request = DummyRequest()
     request.effective_principals = ["basic:foo", "system.Authenticated"]
     request.prefixed_userid = "basic:foo"
     self.assertEqual(prefixed_principals(request),
                      ["basic:foo", "system.Authenticated"])
示例#2
0
 def test_removes_unprefixed_from_principals(self):
     request = DummyRequest()
     request.effective_principals = ["foo", "system.Authenticated"]
     request.prefixed_userid = "basic:foo"
     self.assertEqual(prefixed_principals(request),
                      ["basic:foo", "system.Authenticated"])
示例#3
0
 def test_removes_unprefixed_from_principals(self):
     request = DummyRequest()
     request.effective_principals = ['foo', 'system.Authenticated']
     request.prefixed_userid = 'basic:foo'
     self.assertEqual(prefixed_principals(request),
                      ['basic:foo', 'system.Authenticated'])
示例#4
0
 def test_works_if_userid_is_not_in_principals(self):
     request = DummyRequest()
     request.effective_principals = ['basic:foo', 'system.Authenticated']
     request.prefixed_userid = 'basic:foo'
     self.assertEqual(prefixed_principals(request),
                      ['basic:foo', 'system.Authenticated'])
示例#5
0
 def test_removes_unprefixed_from_principals(self):
     request = DummyRequest()
     request.effective_principals = ['foo', 'system.Authenticated']
     request.prefixed_userid = 'basic:foo'
     self.assertEqual(prefixed_principals(request),
                      ['basic:foo', 'system.Authenticated'])
示例#6
0
 def test_removes_unprefixed_from_principals(self):
     request = DummyRequest()
     request.effective_principals = ["foo", "system.Authenticated"]
     request.prefixed_userid = "basic:foo"
     self.assertEqual(prefixed_principals(request), ["basic:foo", "system.Authenticated"])