Class RequestFactory

Class that lets you create mock Request objects for use in testing.

Declaration

class RequestFactory
source link

Documentation

Usage:

rf = RequestFactory()
get_request = rf.get('/hello/')
post_request = rf.post('/submit/', {'foo': 'bar'})

Once you have a request object you can pass it to any view function,
just as if that view had been hooked up using a URLconf.

Methods

Subclasses

Reexports