docstr: Test that defining redundant consecutive restrictions still works
docstr_tok: ["Test","that","defining","redundant","consecutive","restrictions","still","works"]
code: def test_historical_restrictions_consecutive_states(self):
      """
      Test that defining redundant consecutive restrictions still works
      """
      rl = HistoricalRestrictions(
          [
              Restriction(
                  self.ASSET1, str_to_ts("2011-01-04"), ALLOWED
              ),
              Restriction(
                  self.ASSET1, str_to_ts("2011-01-05"), ALLOWED
              ),
              Restriction(self.ASSET1, str_to_ts("2011-01-06"), FROZEN),
              Restriction(self.ASSET1, str_to_ts("2011-01-07"), FROZEN),
          ]
      )
  
      assert_not_restricted = partial(self.assert_not_restricted, rl)
      assert_is_restricted = partial(self.assert_is_restricted, rl)
  
      # (implicit) ALLOWED --> ALLOWED
      assert_not_restricted(
          self.ASSET1, str_to_ts("2011-01-04") - MINUTE
      )
      assert_not_restricted(self.ASSET1, str_to_ts("2011-01-04"))
      assert_not_restricted(
          self.ASSET1, str_to_ts("2011-01-04") + MINUTE
      )
  
      # ALLOWED --> ALLOWED
      assert_not_restricted(
          self.ASSET1, str_to_ts("2011-01-05") - MINUTE
      )
      assert_not_restricted(self.ASSET1, str_to_ts("2011-01-05"))
      assert_not_restricted(
          self.ASSET1, str_to_ts("2011-01-05") + MINUTE
      )
  
      # ALLOWED --> FROZEN
      assert_not_restricted(
          self.ASSET1, str_to_ts("2011-01-06") - MINUTE
      )
      assert_is_restricted(self.ASSET1, str_to_ts("2011-01-06"))
      assert_is_restricted(
          self.ASSET1, str_to_ts("2011-01-06") + MINUTE
      )
  
      # FROZEN --> FROZEN
      assert_is_restricted(
          self.ASSET1, str_to_ts("2011-01-07") - MINUTE
      )
      assert_is_restricted(self.ASSET1, str_to_ts("2011-01-07"))
      assert_is_restricted(
          self.ASSET1, str_to_ts("2011-01-07") + MINUTE
      )
  
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 7 for calling the RestrictionsTestCase obj's underlying member method code with example usage: obj.test_historical_restrictions_consecutive_states() without return types