'Tests that invalid page numbers result in the correct exception being
raised.'

def test_invalid_page_number(self):

    paginator = Paginator([1, 2, 3], 2)
    self.assertRaises(InvalidPage, paginator.page, 3)
    self.assertRaises(PageNotAnInteger, paginator.validate_number, None)
    self.assertRaises(PageNotAnInteger, paginator.validate_number, u'x')
    paginator = Paginator([], 2)
    self.assertEqual(paginator.validate_number(1), 1)
