Stuck on this for a while:
in Django pytest I am trying to do
req = RequestFactory().get(reverse('app_name:app_view_name'))
But I require the url to have '/[number]' at the end so that UpdateView will recognise the number and display appropriate form from model.
In the browser the links and form submission all work fine, but I am unable to use reverse() in testing. I have tried:
req = RequestFactory().get(reverse('app_name:app_view_name', args=[1]))
and
req = RequestFactory().get(reverse('app_name:app_view_name'), kwargs=['pk'=1])
but none of these work. I am simply trying to build the url with '/1' added at the end.
Any help much appreciated.
It expects a dictionary, like you can find in the documentation: