예제 #1
0
 def test_is_staff_for_nonexistent_user(self):
     from karl.models.peopledirectory import is_staff
     from karl.testing import DummyUsers
     obj = _makeProfile()
     site = testing.DummyModel()
     site['testuser'] = obj
     site.users = DummyUsers()
     self.assertEqual(is_staff(obj, ()), ())
예제 #2
0
 def test_is_staff_for_nonexistent_user(self):
     from karl.models.peopledirectory import is_staff
     from karl.testing import DummyUsers
     obj = _makeProfile()
     site = testing.DummyModel()
     site['testuser'] = obj
     site.users = DummyUsers()
     self.assertEqual(is_staff(obj, ()), ())
예제 #3
0
 def test_is_staff_for_non_profile(self):
     from karl.models.peopledirectory import is_staff
     from karl.testing import DummyUsers
     obj = testing.DummyModel()
     site = testing.DummyModel()
     site['testuser'] = obj
     site.users = DummyUsers()
     site.users.add('testuser', 'testuser', '', [])
     self.assertEqual(is_staff(obj, ()), ())
예제 #4
0
 def test_is_staff_for_staff(self):
     from karl.models.peopledirectory import is_staff
     from karl.testing import DummyUsers
     obj = _makeProfile()
     site = testing.DummyModel()
     site['testuser'] = obj
     site.users = DummyUsers()
     site.users.add('testuser', 'testuser', '', ['group.KarlStaff'])
     self.assertEqual(is_staff(obj, ()), True)
예제 #5
0
 def test_is_staff_for_non_profile(self):
     from karl.models.peopledirectory import is_staff
     from karl.testing import DummyUsers
     obj = testing.DummyModel()
     site = testing.DummyModel()
     site['testuser'] = obj
     site.users = DummyUsers()
     site.users.add('testuser', 'testuser', '', [])
     self.assertEqual(is_staff(obj, ()), ())
예제 #6
0
 def test_is_staff_for_staff(self):
     from karl.models.peopledirectory import is_staff
     from karl.testing import DummyUsers
     obj = _makeProfile()
     site = testing.DummyModel()
     site['testuser'] = obj
     site.users = DummyUsers()
     site.users.add('testuser', 'testuser', '', ['group.KarlStaff'])
     self.assertEqual(is_staff(obj, ()), True)