'Check that django-oauth2-provider gives an appropriate authorization response.'

def _check_dop_response(self, response):

    self.assertRedirects(response, u'http://testserver/oauth2/authorize/confirm', target_status_code=200)
    context = response.context_data
    form = context['form']
    self.assertIsNone(form['authorize'].value())
    oauth_data = context['oauth_data']
    self.assertEqual(oauth_data['redirect_uri'], DUMMY_REDIRECT_URL)
    self.assertEqual(oauth_data['state'], 'random_state_string')
    self.assertEqual(oauth_data['scope'], constants.READ_WRITE)
