Adding extra filter to polls urls.py causes tests to fail
问题 Following the tutorial at djangoproject, I have tried to have urls.py filter out the polls with no choices with the urlpattern below. urlpatterns = patterns('', url(r'^$', ListView.as_view( queryset=Poll.objects.filter(choice__choice_text__isnull=False) \ .filter(pub_date__lte=timezone.now) \ .order_by('-pub_date')[:5], context_object_name='latest_polls', template_name='polls/index.html'), name='index'), url(r'^(?P<pk>\d+)/$', DetailView.as_view( queryset=Poll.objects.filter(choice__choice