Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_budgets(beancount_string):
entries, _, _ = parser.parse_string(beancount_string, dedent=True)
return Budgets(entries)
def test_budgets(load_doc):
"""
2016-01-01 custom "budget" Expenses:Groceries "weekly" 100.00 CNY
2016-06-01 custom "budget" Expenses:Groceries "weekly" 10.00 EUR"""
entries, _, _ = load_doc
budget = Budgets(entries)
budgets = budget.budget('Expenses:Groceries', date(2016, 6, 1), date(2016, 6, 8)) # noqa
assert budgets['CNY'] == Decimal(100)
assert budgets['EUR'] == Decimal(10)