I get the same error upgrading from 
djangorestframework==3.6.3 to djangorestframework==3.7.7


from rest_framework import viewsets
class APIBaseViewSet(viewsets.ViewSet):
       ....


test snippet:

      self.request = request_factory.get('/')
      view = APIBaseViewSet.as_view({'get': 'list'}, 
key='other/pattern/10/')
      response = view(self.request).render()

api_client/tests/test_views.py:53: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
venv/lib/python3.5/site-packages/django/views/decorators/csrf.py:58: in 
wrapped_view
    return view_func(*args, **kwargs)
venv/lib/python3.5/site-packages/rest_framework/viewsets.py:95: in view
    return self.dispatch(request, *args, **kwargs)
venv/lib/python3.5/site-packages/rest_framework/views.py:494: in dispatch
    response = self.handle_exception(exc)
venv/lib/python3.5/site-packages/rest_framework/views.py:454: in 
handle_exception
    self.raise_uncaught_exception(exc)
venv/lib/python3.5/site-packages/rest_framework/views.py:491: in dispatch
    response = handler(request, *args, **kwargs)
api_client/views.py:147: in retrieve
    return self.list(request, *args, **kwargs)
api_client/views.py:142: in list
    data = self._get_data()
api_client/views.py:130: in _get_data
    return self._call_proper_class(self.api_source, self._get_key())
api_client/views.py:116: in _call_proper_class
    return 
json.loads(api_view(self.request).render().content.decode('utf-8'))
venv/lib/python3.5/site-packages/django/views/decorators/csrf.py:58: in 
wrapped_view
    return view_func(*args, **kwargs)
venv/lib/python3.5/site-packages/rest_framework/viewsets.py:95: in view
    return self.dispatch(request, *args, **kwargs)
venv/lib/python3.5/site-packages/rest_framework/views.py:477: in dispatch
    request = self.initialize_request(request, *args, **kwargs)
venv/lib/python3.5/site-packages/rest_framework/viewsets.py:118: in 
initialize_request
    request = super(ViewSetMixin, self).initialize_request(request, *args, 
**kwargs)
venv/lib/python3.5/site-packages/rest_framework/views.py:381: in 
initialize_request
    parser_context=parser_context
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <rest_framework.request.Request object at 0x80dab0a90>, request = 
<rest_framework.request.Request object at 0x80da9fe48>
parsers = [<rest_framework.parsers.JSONParser object at 0x80dab0240>, 
<rest_framework.parsers.FormParser object at 0x80dab0320>, 
<rest_framework.parsers.MultiPartParser object at 0x80dab0358>]
authenticators = [<rest_framework.authentication.SessionAuthentication 
object at 0x80dab0278>, <rest_framework.authentication.BasicAuthentication 
object at 0x80dab0a20>]
negotiator = <rest_framework.negotiation.DefaultContentNegotiation object 
at 0x80dab09e8>
parser_context = {'args': (), 'kwargs': {}, 'view': 
<api_client.views.APIViewSet object at 0x80dab07b8>}

    def __init__(self, request, parsers=None, authenticators=None,
                 negotiator=None, parser_context=None):
        assert isinstance(request, HttpRequest), (
            'The `request` argument must be an instance of '
            '`django.http.HttpRequest`, not `{}.{}`.'
>           .format(request.__class__.__module__, 
request.__class__.__name__)
        )
E       AssertionError: The `request` argument must be an instance of 
`django.http.HttpRequest`, not `rest_framework.request.Request`.

venv/lib/python3.5/site-packages/rest_framework/request.py:159: 
AssertionError





On Wednesday, 27 December 2017 20:51:37 UTC, Escher wrote:
>
> 3.7.4 is breaking my generics.ListAPIView views compared to 3.7.3: I'm 
> getting the AssertionError (here 
> <https://github.com/encode/django-rest-framework/blob/master/rest_framework/request.py#L156>)
>  
> on my ListAPIView classes. They generally look like this:
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to