'Test if we can do logins
django_facebook.connect.connect_user'

def test_slow_connect(self):

    url = reverse('facebook_connect')
    example_url = reverse('facebook_example')
    errors = [FacebookSSLError(), FacebookURLError('<urlopen    error    _ssl.c:489:    The    handshake    operation    timed    out>')]
    for error in errors:
        with patch('django_facebook.views.get_instance_for') as converter:
            instance = converter.return_value
            instance.is_authenticated = Mock(side_effect=error)
            post_data = dict(access_token='short_username', next=('%s?loggggg=1' % example_url))
            response = self.client.post(url, post_data, follow=True)
            self.assertEqual(instance.is_authenticated.call_count, 1)
            self.assertTrue(response.context)
            assert ('?loggggg=1' in response.redirect_chain[0][0])
