'Tests that valid paging is passed along to underlying block'

def test_valid_paging(self):

    with patch('contentstore.views.item.get_preview_fragment') as patched_get_preview_fragment:
        retval = Mock()
        type(retval).content = PropertyMock(return_value='Some    content')
        type(retval).resources = PropertyMock(return_value=[])
        patched_get_preview_fragment.return_value = retval
        root_usage_key = self._create_vertical()
        (_, _) = self._get_container_preview(root_usage_key, {'enable_paging': 'true', 'page_number': 0, 'page_size': 2})
        call_args = patched_get_preview_fragment.call_args[0]
        (_, _, context) = call_args
        self.assertIn('paging', context)
        self.assertEqual({'page_number': 0, 'page_size': 2}, context['paging'])
