diff --git a/tests/test_fincal.py b/tests/test_fincal.py index b169040..f45ea64 100644 --- a/tests/test_fincal.py +++ b/tests/test_fincal.py @@ -221,3 +221,11 @@ class TestReturns: returns1 = ts.calculate_returns("2020-04-10", interval_type='days', interval_value=90, date_format='%Y-%m-%d') returns2 = ts.calculate_returns("10-04-2020", interval_type='days', interval_value=90) assert round(returns1, 4) == round(returns2, 4) == 5.727 + + FincalOptions.date_format = '%m-%d-%Y' + with pytest.raises(ValueError): + ts.calculate_returns("2020-04-10", compounding=True, interval_type='days', interval_value=90) + + returns1 = ts.calculate_returns("2020-04-10", interval_type='days', interval_value=90, date_format='%Y-%m-%d') + returns2 = ts.calculate_returns("04-10-2020", interval_type='days', interval_value=90) + assert round(returns1, 4) == round(returns2, 4) == 5.727