コード例 #1
0
ファイル: test_roles.py プロジェクト: iivvoo/django_drole
 def test_all(self):
     """ retrieve all created permissions """
     r1 = Role.create("r1")
     r2 = Role.create("r2")
     r3 = Role.create("r2") # duplicate!
     assert set(Role.all()) == set((r1, r2))
コード例 #2
0
ファイル: test_roles.py プロジェクト: iivvoo/django_drole
 def test_uniqueness_differ(self):
     """ 
         Role with different identifier are not equal
     """
     assert Role.create("foo") != Role("bar")
コード例 #3
0
ファイル: test_roles.py プロジェクト: iivvoo/django_drole
 def test_equality(self):
     """ ordinary comparison. Will succeed since it will be the same
         objects """
     assert Role.create("foo") == Role.create("foo")
コード例 #4
0
ファイル: test_roles.py プロジェクト: iivvoo/django_drole
 def test_uniqueness_attrs(self):
     """ Different instances with same identifier are identical, even
         if other attributes differ """
     assert Role.create("foo", "bar", "bla") is \
            Role.create("foo", "this", "that")
コード例 #5
0
ファイル: test_roles.py プロジェクト: iivvoo/django_drole
 def test_uniqueness_id(self):
     """ Different instances with same identifier are identical """
     assert Role.create("foo") is Role.create("foo")
コード例 #6
0
ファイル: test_roles.py プロジェクト: iivvoo/django_drole
 def test_create(self):
     """ Role are implicitly created """
     assert Role.create("foo") is not None
コード例 #7
0
ファイル: test_roles.py プロジェクト: iivvoo/django_drole
 def test_unicode(self):
     assert isinstance(Role.create("foo").__unicode__(), unicode)
コード例 #8
0
ファイル: auth.py プロジェクト: wheelcms/wheelcms_axle
def Role(id, name="", description=""):
    return droleRole.create(id, name, description)