def test_caps(self): r = Role.find('用户') caps = r['caps'] caps.sort() assert tuple(caps) == ('c1', 'c2', )
def test_hascap(self): r = Role.find('用户') assert r.hascap('c1') assert not r.hascap('c100') assert 'c2' in r assert 'c200' not in r
def test_find(self): assert Role.find('用户') assert_raises(KeyError, Role.find, '不存在')