Server IP : 66.29.132.122 / Your IP : 18.188.226.93 Web Server : LiteSpeed System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : admazpex ( 531) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/opt/cloudlinux/venv/lib64/python3.11/site-packages/pylint_django/tests/input/ |
Upload File : |
""" Checks that Pylint still complains about unused-arguments for other arguments if a function/method contains an argument named `request`. """ # pylint: disable=missing-docstring from django.http import JsonResponse from django.views import View # Pylint generates the warning `redefined-outer-name` if an argument name shadows # a variable name from an outer scope. But if that argument name is ignored this # warning will not be generated. # Therefore define request here to cover this behaviour in this test case. request = None # pylint: disable=invalid-name def user_detail(request, user_id): # [unused-argument] # nothing is done with user_id return JsonResponse({"username": "steve"}) class UserView(View): def get(self, request, user_id): # [unused-argument] # nothing is done with user_id return JsonResponse({"username": "steve"}) # The following views are already covered in other test cases. # They are included here for completeness sake. def welcome_view(request): # just don't use `request' b/c we could have Django views # which never use it! return JsonResponse({"message": "welcome"}) class CBV(View): def get(self, request): return JsonResponse({"message": "hello world"})