summaryrefslogtreecommitdiff
path: root/tests/check_framework/urls/cbv_as_view.py
diff options
context:
space:
mode:
authorAngus Holder <aholder97@gmail.com>2020-11-14 17:25:57 +0000
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-06-09 09:06:42 +0200
commit3e73c65ffcf263d5ccd107589452a4615281a0e8 (patch)
tree8dc22276119e1ef908452d4b1a6a37ad3932e54b /tests/check_framework/urls/cbv_as_view.py
parent8f89454bbc873a117cc8614f2d1f1fbfd4e79ee4 (diff)
downloaddjango-3e73c65ffcf263d5ccd107589452a4615281a0e8.tar.gz
Fixed #32195 -- Added system check for invalid view in path() and improved error messages.
Diffstat (limited to 'tests/check_framework/urls/cbv_as_view.py')
-rw-r--r--tests/check_framework/urls/cbv_as_view.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/check_framework/urls/cbv_as_view.py b/tests/check_framework/urls/cbv_as_view.py
new file mode 100644
index 0000000000..932a2bfcc9
--- /dev/null
+++ b/tests/check_framework/urls/cbv_as_view.py
@@ -0,0 +1,19 @@
+from django.http import HttpResponse
+from django.urls import path
+from django.views import View
+
+
+class EmptyCBV(View):
+ pass
+
+
+class EmptyCallableView:
+ def __call__(self, request, *args, **kwargs):
+ return HttpResponse()
+
+
+urlpatterns = [
+ path('missing_as_view', EmptyCBV),
+ path('has_as_view', EmptyCBV.as_view()),
+ path('callable_class', EmptyCallableView()),
+]