Ejemplo n.º 1
0
    def test_with_one_staff_role(self):
        role = models.Role(code='testrole')

        with self.settings(SSO_CLIENT_STAFF_ROLES=('testrole',)):
            signals.set_superuser_staff_callback(self.user, [(None, role)])
            self.assertTrue(self.user.is_staff)
            self.assertFalse(self.user.is_superuser)
Ejemplo n.º 2
0
 def test_without_settings(self):
     signals.set_superuser_staff_callback(self.user, [])
     self.assertFalse(self.user.is_staff)
     self.assertFalse(self.user.is_superuser)