'Test that defining redundant consecutive restrictions still works'

def test_historical_restrictions_consecutive_states(self):

    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)
    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))
    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))
    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))
    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))
