Skip to content

Commit 78a3206

Browse files
committed
Python: Add test with unkown view class in django
1 parent 42eceb8 commit 78a3206

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • python/ql/test/experimental/library-tests/frameworks/django-v2-v3

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,13 @@ def with_decorator(request, foo): # $ requestHandler routedParameter=foo
140140
urlpatterns = [
141141
path("with_decorator/<foo>", with_decorator), # $ routeSetup="with_decorator/<foo>"
142142
]
143+
144+
class UnknownViewSubclass(UnknownViewSuperclass):
145+
# Although we don't know for certain that this class is a django view class, the fact that it's
146+
# used with `as_view()` in the routing setup should be enough that we treat it as such.
147+
def get(self, request): # $ MISSING: requestHandler
148+
pass
149+
150+
urlpatterns = [
151+
path("UnknownViewSubclass/", UnknownViewSubclass.as_view()), # $ routeSetup="UnknownViewSubclass/"
152+
]

0 commit comments

Comments
 (0)