-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Description
In a view, I have define a get_queryset
method in a APIView
derived class. For some (not important) reasons, I have made a mistake in my code, but the error message I get is unrelated to the actual mistake: it is an AssertError
, complaining there is no .queryset
attribute or get_queryset
method in the view. And the traceback does only imply files of the framework, not files I haver written and, obviously, neither the file I have made the mistake in.
Steps to reproduce
Create a class in views.py
, deriving from APIView
. Define a get_queryset
method with a mistake in it, say an the method do not return anything. Run it.IndexError
.
Txpected behavior
Get an error message involving an IndexError
.
Get an error message about the empty return of get_queryset
.
Actual behavior
Get an error message related to an AssertError
.