示例#1
0
 def test_tagged_paggination_view_with_page2_parameter(self):
     url = reverse('tag_list', kwargs={'tag': 'tag1'})
     request = self.factory.get(url, {'p': 2})
     tpv = TaggedPublishablesView.as_view()
     response = tpv(request, tag='tag1')
     self.assert_true(200, response.status_code)
     self.assert_true(response.context_data['is_paginated'])
     self.assert_equals(1, response.context_data['results_per_page'])
     self.assert_equals(self.tag, response.context_data['tag'])
     self.assert_equals(1, len(response.context_data['object_list']))
     self.assert_equals(self.only_pub,
                        response.context_data['object_list'][0])
示例#2
0
文件: urls.py 项目: whit/ella
from django.conf.urls.defaults import *
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext # lazy gettext works strange in case of urlpatterns (sometimes doesn't work)

from ella.ellatagging.views import TaggedPublishablesView


urlpatterns = patterns('',
    url(r'^(?P<tag>[\w\s]+)/', TaggedPublishablesView.as_view(), name="tag_list"),
)