I\'m trying to use RequestFactory to test a DetailView with the following test case:
def test_device_homepage(self):
request = self.factory.get(\'/devices/1/
Thanks to the #django channel on Freenode IRC, I found the following method is the correct one to pass parameters all the way through to the view:
response = DeviceView.as_view()(request, pk=1)
I hope this helps somebody else attempting to use RequestFactory to test DetailView or DeleteView etc