docstr: 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.
docstr_tok: ["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","."]
code: def test_data_items(self):
      """
      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.
      """
      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.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),
                  )
  
imports: import warnings
  from mock import patch
  import numpy
  import pandas
  from pandas.core.common import PerformanceWarning
  from zipline.finance.trading import SimulationParameters
  from zipline.testing import MockDailyBarReader, create_daily_df_for_asset, create_minute_df_for_asset, str_to_seconds
  from zipline.testing.fixtures import WithCreateBarData, WithMakeAlgo, ZiplineTestCase
  from zipline.zipline_warnings import ZiplineDeprecationWarning
label_desc: Use image node_id 9 for calling the TestAPIShim obj's underlying member method code with example usage: obj.test_data_items() without return types