'Test the page returned has the expected db objects and acts
like a proper page object using \'last\' keyword.'

def test_paginated_results_last_keyword(self):

    page_number = 2
    page_size = 3
    id_range = get_object_range(page_number, page_size)
    db_objects = [build_mock_object(obj_id) for obj_id in id_range]
    self.mock_model.objects.filter = MagicMock(return_value=db_objects)
    page = paginate_search_results(self.mock_model, self.search_results, page_size, 'last')
    self.mock_model.objects.filter.assert_called_with(pk__in=id_range)
    self.assertEquals(db_objects, page.object_list)
    self.assertTrue(page.number, page_number)
    self.assertFalse(page.has_next())
