

def test_post_with_anonymous(self):
    data = {
        'name': 'test app',
        'description': '',
        'download_url': 'http://example.com/download',
        'redirect_uris': 'http://example.com/redirect',
        'authorization_grant_type': 'password',
    }
    view = ApplicationSettings.as_view()
    url = reverse('admin:app_settings', kwargs={
        'app_id': self.app.id,
    })
    request = APIRequestFactory().post(request, data)
    request.user = AnonymousUser()
    response = view(request, app_id=self.app.id)
    self.assertTrue(isinstance(response, HttpResponseRedirect))
    ref = Application.objects.get(pk=self.app.id)
    self.assertNotEqual(ref.name, data.get('name'))
    self.assertNotEqual(ref.description, data.get('description'))
    self.assertNotEqual(ref.download_url, data.get('download_url'))
    self.assertNotEqual(ref.redirect_uris, data.get('redirect_uris'))
    self.assertNotEqual(ref.authorization_grant_type, data.get('authorization_grant_type'))

dataset/ETHPy150Open ExCiteS/geokey/geokey/applications/tests/test_views.py ApplicationSettingsTest.test_post_with_anonymous/VarMisuse@79/138 `url`->`request`