Source

django-class-views-experiments / copyoncall.py

Diff from to

File copyoncall.py

 
 def mydec(func):
     def _wrapper(*args, **kwargs):
+        assert isinstance(args[0], HttpRequest)
         return func(*args, **kwargs)
     return _wrapper
 
 
 responses = []
 
+class HttpRequest(object):
+    pass
+
 def runview():
     global responses
-    request = object()
+    request = HttpRequest()
     responses.append(view(request))
 
 # Concurrent threads: