docstr: Test single- and multi-asset queries on restrictions defined by
  zipline.utils.security_list.SecurityList
docstr_tok: ["Test","single-","and","multi-asset","queries","on","restrictions","defined","by","zipline.utils.security_list.SecurityList"]
code: def test_security_list_restrictions(self):
      """
      Test single- and multi-asset queries on restrictions defined by
      zipline.utils.security_list.SecurityList
      """
  
      # A mock SecurityList object filled with fake data
      class SecurityList(object):
          def __init__(self, assets_by_dt):
              self.assets_by_dt = assets_by_dt
  
          def current_securities(self, dt):
              return self.assets_by_dt[dt]
  
      assets_by_dt = {
          str_to_ts("2011-01-03"): [self.ASSET1],
          str_to_ts("2011-01-04"): [self.ASSET2, self.ASSET3],
          str_to_ts("2011-01-05"): [
              self.ASSET1,
              self.ASSET2,
              self.ASSET3,
          ],
      }
  
      rl = SecurityListRestrictions(SecurityList(assets_by_dt))
  
      assert_not_restricted = partial(self.assert_not_restricted, rl)
      assert_is_restricted = partial(self.assert_is_restricted, rl)
      assert_all_restrictions = partial(
          self.assert_all_restrictions, rl
      )
  
      assert_is_restricted(self.ASSET1, str_to_ts("2011-01-03"))
      assert_not_restricted(self.ASSET2, str_to_ts("2011-01-03"))
      assert_not_restricted(self.ASSET3, str_to_ts("2011-01-03"))
      assert_all_restrictions(
          [True, False, False], str_to_ts("2011-01-03")
      )
  
      assert_not_restricted(self.ASSET1, str_to_ts("2011-01-04"))
      assert_is_restricted(self.ASSET2, str_to_ts("2011-01-04"))
      assert_is_restricted(self.ASSET3, str_to_ts("2011-01-04"))
      assert_all_restrictions(
          [False, True, True], str_to_ts("2011-01-04")
      )
  
      assert_is_restricted(self.ASSET1, str_to_ts("2011-01-05"))
      assert_is_restricted(self.ASSET2, str_to_ts("2011-01-05"))
      assert_is_restricted(self.ASSET3, str_to_ts("2011-01-05"))
      assert_all_restrictions(
          [True, True, True], str_to_ts("2011-01-05")
      )
  
imports: import pandas
  from pandas.util.testing import assert_series_equal
  from six import iteritems
  from functools import partial
  from toolz import groupby
  from zipline.finance.asset_restrictions import RESTRICTION_STATES, Restriction, HistoricalRestrictions, StaticRestrictions, SecurityListRestrictions, NoRestrictions, _UnionRestrictions
  from zipline.testing import parameter_space
  from zipline.testing.fixtures import WithDataPortal, ZiplineTestCase
label_desc: Use image node_id 9 for calling the RestrictionsTestCase obj's underlying member method code with example usage: obj.test_security_list_restrictions() and returns: self