def test_attributes_required(self):
        backend = PermissionBackend()

        self.assertTrue(hasattr(backend, 'supports_object_permissions'))
        self.assertTrue(getattr(backend, 'supports_object_permissions'))

        self.assertTrue(hasattr(backend, 'supports_anonymous_user'))
        self.assertTrue(getattr(backend, 'supports_anonymous_user'))

        self.assertTrue(hasattr(backend, 'supports_inactive_user'))
        self.assertTrue(getattr(backend, 'supports_inactive_user'))

        self.assertTrue(hasattr(backend, 'authenticate'))
        self.assertEqual(backend.authenticate(None, None), None)

        self.assertTrue(hasattr(backend, 'has_perm'))
Exemplo n.º 2
0
    def test_attributes_required(self):
        backend = PermissionBackend()

        self.assertTrue(hasattr(backend, 'supports_object_permissions'))
        self.assertTrue(getattr(backend, 'supports_object_permissions'))

        self.assertTrue(hasattr(backend, 'supports_anonymous_user'))
        self.assertTrue(getattr(backend, 'supports_anonymous_user'))

        self.assertTrue(hasattr(backend, 'supports_inactive_user'))
        self.assertTrue(getattr(backend, 'supports_inactive_user'))

        self.assertTrue(hasattr(backend, 'authenticate'))
        self.assertEqual(backend.authenticate(None, None), None)

        self.assertTrue(hasattr(backend, 'has_perm'))
Exemplo n.º 3
0
 def test_authenticate(self):
     backend = PermissionBackend()
     self.assertEqual(backend.authenticate(None, None), None)
 def test_authenticate(self):
     backend = PermissionBackend()
     self.assertEqual(backend.authenticate(None, None), None)