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

def test_page_getitem(self):

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