def test_deauthorized_user(self):

        client = Client()

        with patch.object(GraphAPI, 'get') as graph_get:

            def side_effect(*args, **kwargs):
                if args[0] == 'oauth/access_token':
                    return TEST_GRAPH_ACCESS_TOKEN_RESPONSE
                elif args[0] == 'me':
                    return TEST_GRAPH_ME_RESPONSE

            graph_get.side_effect = side_effect

            client.get(
                path = reverse('home'),
                data = {
                    'code': TEST_AUTH_CODE
                }
            )

        client.post(
            path = reverse('deauthorize_application'),
            data = {
                'signed_request': TEST_SIGNED_REQUEST
            }
        )

        client.cookies['signed_request'] = None

        response = client.get(
            path = reverse('home')
        )

        assert response.status_code == 401
Check user cannot log in after deauthrorizing app.
dataset/ETHPy150Open jgorset/fandjango/tests/test_fandjango.py/TestFacebookMultipleMiddleware.test_deauthorized_user