def test_paginate(self):
    'Places Pager object in context with size/num from request.'
    from moztrap.model.tags.models import Tag
    tpl = template.Template('{% load pagination %}{% paginate queryset as pager %}{% for obj in pager.objects %}{{ obj }} {% endfor %}')
    request = Mock()
    request.GET = {'pagesize': 3, 'pagenumber': 2}
    for i in range(1, 7):
        self.F.TagFactory.create(name=str(i))
    qs = Tag.objects.all()
    output = tpl.render(template.Context({'request': request, 'queryset': qs}))
    self.assertEqual(output, '4 5 6 ')
Places Pager object in context with size/num from request.
def test_paginate(self):
    
    from moztrap.model.tags.models import Tag
    tpl = template.Template('{% load pagination %}{% paginate queryset as pager %}{% for obj in pager.objects %}{{ obj }} {% endfor %}')
    request = Mock()
    request.GET = {'pagesize': 3, 'pagenumber': 2}
    for i in range(1, 7):
        self.F.TagFactory.create(name=str(i))
    qs = Tag.objects.all()
    output = tpl.render(template.Context({'request': request, 'queryset': qs}))
    self.assertEqual(output, '4 5 6 ')