'Tests proper behaviour of a paginator page __getitem__ (queryset
evaluation, slicing, exception raised).'

def test_page_getitem(self):

    paginator = Paginator(Article.objects.all(), 5)
    p = paginator.page(1)
    self.assertIsNone(p.object_list._result_cache)
    self.assertRaises(TypeError, (lambda : p[u'has_previous']))
    self.assertIsNone(p.object_list._result_cache)
    self.assertNotIsInstance(p.object_list, list)
    self.assertEqual(p[0], Article.objects.get(headline=u'Article    1'))
    self.assertQuerysetEqual(p[slice(2)], [u'<Article:    Article    1>', u'<Article:    Article    2>'])
    self.assertIsInstance(p.object_list, list)
