from django.conf.urls import patterns, url from activities.views import ActivityList, ActivityDetail urlpatterns = patterns( '', url(r'(?P<pk>\d+)/?$', ActivityDetail.as_view(), name='activity-detail'), url(r'$', ActivityList.as_view(), name='activity-list') )
def setUp(self): self.factory = APIRequestFactory() self.request = self.factory.get("get_activities/", {"refresh": "true"}) self.request.user = ExtendedUser.objects.create_user(username="******", password="******") self.response = ActivityList.as_view()(self.request)
from django.urls import path from activities.views import ActivityList urlpatterns = [ path('', ActivityList.as_view(), name='index'), ]