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

@ddt.data((1, 1, True), (1, 3, True), (1, 5, True), (1, 10, False), (2, 1, True), (2, 3, False), (2, 5, False))
@ddt.unpack
def test_paginated_results(self, page_number, page_size, has_next):

    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, page_number)
    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.assertEquals(page.has_next(), has_next)
