'The redirect flow for facebook works as follows
- request the decorated url, /facebook/connect/
- the decorator (facebook_required) redirect the user to the oauth url
- after accepting the auth dialog facebook redirects us to the next url'

def test_connect_redirect(self):

    response = self.client.post(self.url, next=self.example_url, follow=True)
    redirect_url = response.redirect_chain[0][0]
    oauth_url = 'https://www.facebook.com/dialog/oauth?scope=email%2Cuser_about_me%2Cuser_birthday%2Cuser_website&redirect_uri=http%3A%2F%2Ftestserver%2Ffacebook%2Fconnect%2F%3Fattempt%3D1&client_id=215464901804004'
    if six.PY3:
        self.assertEqual(response.redirect_chain[0][1], 302)
    else:
        self.assertEqual(redirect_url, oauth_url)
