'Test that we maintain backwards compat for data.[items | iteritems].
We also want to assert that we warn that iterating over the assets
in `data` is deprecated.'

def test_data_items(self):

    with warnings.catch_warnings(record=True) as w:
        warnings.simplefilter('ignore', PerformanceWarning)
        warnings.simplefilter('default', ZiplineDeprecationWarning)
        algo = self.create_algo(data_items_algo)
        algo.run(self.data_portal)
        self.assertEqual(4, len(w))
        for (idx, warning) in enumerate(w):
            self.assertEqual(ZiplineDeprecationWarning, warning.category)
            if ((idx % 2) == 0):
                self.assertEqual('Iterating    over    the    assets    in    `data`    is    deprecated.', str(warning.message))
            else:
                self.assertEqual('`data[sid(N)]`    is    deprecated.    Use    `data.current`.', str(warning.message))
