Exemple #1
0
    def test_user_auto_create(self, verify):
        username = '******'
        verify.return_value = username
        backend = CASBackend()

        with self.settings(CAS_AUTO_CREATE_USER=False):
            user = backend.authenticate('fake', 'fake')
            self.assertIsNone(user)

        with self.settings(CAS_AUTO_CREATE_USER=True):
            user = backend.authenticate('fake', 'fake')
            self.assertEquals(user.username, username)
Exemple #2
0
    def test_user_auto_create(self, verify):
        username = '******'
        verify.return_value = username
        backend = CASBackend()

        with self.settings(CAS_AUTO_CREATE_USER=False):
            user = backend.authenticate('fake', 'fake')
            self.assertIsNone(user)

        with self.settings(CAS_AUTO_CREATE_USER=True):
            user = backend.authenticate('fake', 'fake')
            self.assertEquals(user.username, username)
Exemple #3
0
    def test_get_user(self):
        backend = CASBackend()

        self.assertEqual(backend.get_user(self.user.pk), self.user)
Exemple #4
0
    def test_get_user(self):
        backend = CASBackend()

        self.assertEqual(backend.get_user(self.user.pk), self.user)