Simon Willison’s Weblog

Subscribe
Atom feed for httprequest

1 item tagged “httprequest”

2008

Django snippets: RequestFactory. I’ve been wanting this for ages; when I finally got around to writing it it turned out to only be a dozen or so lines of code. Makes it easy to create mock request objects in Django, which you can then use for testing view functions directly (bypassing the current test client mechanism which requires views to be assigned to a URLconf before they can be tested).

# 12th August 2008, 12:40 pm / code, django, httprequest, python, requestfactory, testing