Exemplo n.º 1
0
 def test_add_role(self):
     user = CtsUserFactory(role=ROLE_PARTNER)
     self.assertTrue(user.has_role(ROLE_PARTNER))
     self.assertFalse(user.has_role(ROLE_COORDINATOR))
     user.add_role(ROLE_COORDINATOR)
     self.assertTrue(user.has_role(ROLE_COORDINATOR))
Exemplo n.º 2
0
 def test_has_role(self):
     user = CtsUserFactory(role=ROLE_PARTNER)
     self.assertTrue(user.has_role(ROLE_PARTNER))
     self.assertFalse(user.has_role(ROLE_COORDINATOR))
     user.groups.add(Group.objects.get(name=ROLE_COORDINATOR))
     self.assertTrue(user.has_role(ROLE_COORDINATOR))
Exemplo n.º 3
0
 def test_has_role(self):
     user = CtsUserFactory(role=ROLE_PARTNER)
     self.assertTrue(user.has_role(ROLE_PARTNER))
     self.assertFalse(user.has_role(ROLE_COORDINATOR))
     user.groups.add(Group.objects.get(name=ROLE_COORDINATOR))
     self.assertTrue(user.has_role(ROLE_COORDINATOR))
Exemplo n.º 4
0
 def test_add_role(self):
     user = CtsUserFactory(role=ROLE_PARTNER)
     self.assertTrue(user.has_role(ROLE_PARTNER))
     self.assertFalse(user.has_role(ROLE_COORDINATOR))
     user.add_role(ROLE_COORDINATOR)
     self.assertTrue(user.has_role(ROLE_COORDINATOR))