def test_new_user_authenticate(self): backend = JWTAuthenticationBackend() token = self.new_valid_token user = backend.authenticate(decode_token(token)) self.assertEqual(user.username, 'bubbles') self.assertTrue(user.is_superuser) self.assertFalse(user.is_staff)
def test_clean_username(self): backend = JWTAuthenticationBackend() token = self.valid_token username = backend.clean_username(decode_token(token)) self.assertEqual(username, self.user.username)