def setUp(self): '''Instantiate objects needed to test create and list view.''' self.factory = APIRequestFactory() self.user = User.objects.create(username='******', email='*****@*****.**', password="******") self.view = PageList.as_view()
from django.urls import path # from api.views import QuestionList, QuestionDetail from api.views import PageList, PageDetail # urlpatterns = [ # path('wiki/', QuestionList.as_view(), name='wiki_list'), # path('wiki/<int:pk>', QuestionDetail.as_view(), name='wiki_detail') # ] urlpatterns = [ path('', PageList.as_view(), name='wiki-list-page'), path('<str:slug>/', PageDetail.as_view(), name='wiki-details-page'), ]
from django.urls import path from api.views import PageList, PageDetail urlpatterns = [ path('pages/', PageList.as_view(), name='page_list'), path('pages/<int:pk>', PageDetail.as_view(), name='page_detail') ]
from django.urls import path from api.views import PageList urlpatterns = [ path('wiki/', PageList.as_view(), name='wiki_list'), ]
from django.urls import path from api.views import PageList, PageDetail urlpatterns = [ path('wiki', PageList.as_view(), name='page_list'), path('wiki/<int:pk>', PageDetail.as_view(), name='page_detail'), ]