Skip to content

Commit a9bbe1d

Browse files
committed
Python: Test Django un-routed class-based route handler
1 parent 0c78fb2 commit a9bbe1d

File tree

1 file changed

+8
-0
lines changed
  • python/ql/test/experimental/library-tests/frameworks/django-v2-v3

1 file changed

+8
-0
lines changed

python/ql/test/experimental/library-tests/frameworks/django-v2-v3/routing_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,11 @@ def deprecated(request): # $routeHandler
107107
urlpatterns = [
108108
url(r"^deprecated/", deprecated), # $routeSetup="^deprecated/"
109109
]
110+
111+
112+
class PossiblyNotRouted(View):
113+
# Even if our analysis can't find a route-setup for this class, we should still
114+
# consider it to be a handle incoming HTTP requests
115+
116+
def get(self, request, possibly_not_routed=42): # $ MISSING: routeHandler routedParameter=possibly_not_routed
117+
return HttpResponse('PossiblyNotRouted get: {}'.format(possibly_not_routed)) # $HttpResponse

0 commit comments

Comments
 (0)