def test_journal_with_account_func_and_from(self): journal = self.parse("JOURNAL 'liabilities' AT cost FROM year = 2014;") select = qc.transform_journal(journal) self.assertEqual( select, qp.Select([ qp.Target(qp.Column('date'), None), qp.Target(qp.Column('flag'), None), qp.Target( qp.Function('maxwidth', [qp.Column('payee'), qp.Constant(48)]), None), qp.Target( qp.Function('maxwidth', [qp.Column('narration'), qp.Constant(80)]), None), qp.Target(qp.Column('account'), None), qp.Target(qp.Function('cost', [qp.Column('position')]), None), qp.Target(qp.Function('cost', [qp.Column('balance')]), None), ], qp.From(qp.Equal(qp.Column('year'), qp.Constant(2014)), None, None, None), qp.Match(qp.Column('account'), qp.Constant('liabilities')), None, None, None, None, None))
def test_journal(self): journal = self.parse("JOURNAL;") select = qc.transform_journal(journal) self.assertEqual( qp.Select([ qp.Target(qp.Column('date'), None), qp.Target(qp.Column('flag'), None), qp.Target( qp.Function('maxwidth', [qp.Column('payee'), qp.Constant(48)]), None), qp.Target( qp.Function('maxwidth', [qp.Column('narration'), qp.Constant(80)]), None), qp.Target(qp.Column('account'), None), qp.Target(qp.Column('position'), None), qp.Target(qp.Column('balance'), None), ], None, None, None, None, None, None, None, None), select)