def test_data_detail_view(self): """ Just to make certain we have the tests wired up right""" # Get the URL # Create a request request = self.factory.get('/fake-url') # Generate a response response = DataDetailView.as_view()(request, pk=self.data.pk) # Check to see if we had a 404 or not self.response_200(response)
from django.conf.urls import url, include from test_app.views import DataDetailView urlpatterns = [ url(r'^spam/', include('spam.urls', namespace='spam')), url( regex="^(?P<pk>\d+)/$", view=DataDetailView.as_view(), name="data", ), ]