コード例 #1
0
ファイル: web.py プロジェクト: pmarciniak/beancount
def get_all_view(app):
    """Return a view of all transactions.

    Returns:
      An instance of AllView, that covers all transactions.
    """
    return views.AllView(app.entries, app.options, 'All Transactions')
コード例 #2
0
    def test_AllView(self):
        view = views.AllView(self.entries, self.options_map, 'All')
        self.assertNotEqual([], view.entries)
        self.assertEqual([], view.opening_entries)
        self.assertNotEqual([], view.closing_entries)

        self.assertNotEqual(self.empty_realization, view.real_accounts)
        self.assertEqual(self.empty_realization, view.opening_real_accounts)
        self.assertNotEqual(self.empty_realization, view.closing_real_accounts)
コード例 #3
0
    def test_from_empty(self):
        # Test with no input.
        entries, errors, options_map = loader.load_string("")
        self.assertFalse(errors)
        self.assertEqual([], entries)

        view = views.AllView(entries, options_map, 'FROM_EMPTY')
        self.assertEqual(entries, view.all_entries)
        self.assertEqual('FROM_EMPTY', view.title)

        self.assertEqual([], view.entries)
        self.assertEqual([], view.opening_entries)
        self.assertEqual([], view.closing_entries)

        self.assertTrue(isinstance(view.real_accounts, realization.RealAccount))
        self.assertTrue(isinstance(view.opening_real_accounts, realization.RealAccount))
        self.assertTrue(isinstance(view.closing_real_accounts, realization.RealAccount))