Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

src/d/j/django-admin2-HEAD/example/blog/tests/test_apiviews.py   django-admin2(Download)
    def test_response_ok(self):
        request = self.factory.get(reverse('admin2:api_index'))
        request.user = self.user
        view = apiviews.IndexAPIView.as_view(**default.get_api_index_kwargs())
        response = view(request)
    def test_view_permission(self):
        request = self.factory.get(reverse('admin2:api_index'))
        request.user = AnonymousUser()
        view = apiviews.IndexAPIView.as_view(**default.get_api_index_kwargs())
        self.assertRaises(PermissionDenied, view, request)