[Answered ]-Django "NoReverseMatch: Reverse for 'ads.views.AdListView' not found" while doing Test

1👍

Since you use an app_name=… in your urls.py, you need to specify this as a namespace in the name of the view, so ads:ad_detail, and specify a primary key:

resp = self.client.get(reverse('ads:ad_detail', kwargs={'pk': 42}))

So here we visit the URL where 42 is used as value for the pk URL parameter.

Leave a comment