BUG: Normalize dates in AssetDateBounds control checks

Assumes that if a given asset's end_date is
e.g. 9/17/2015 00:00:00 UTC that it means the
asset is still tradeable on 9/17/2015 during
the market day.
This commit is contained in:
John Ricklefs
2015-09-18 15:19:15 -04:00
parent 88495ce9b7
commit 38ff4cc913
2 changed files with 42 additions and 6 deletions
+13
View File
@@ -1573,6 +1573,19 @@ class TestTradingControls(TestCase):
with self.assertRaises(TradingControlViolation):
algo.run(df_source)
# Run the algorithm with a sid that starts on the first day and
# ends on the last day of the algorithm's parameters (*not* an error).
temp_env = TradingEnvironment()
df_source, _ = factory.create_test_df_source(self.sim_params, temp_env)
metadata = {0: {'start_date': '2006-01-03',
'end_date': '2006-01-06'}}
algo = SetAssetDateBoundsAlgorithm(
equities_metadata=metadata,
sim_params=self.sim_params,
env=temp_env,
)
algo.run(df_source)
class TestAccountControls(TestCase):