def test_TagView(self): view = views.TagView(self.entries, self.options_map, 'Tag', {'trip1'}) 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) view = views.TagView(self.entries, self.options_map, 'Tag', {'trip-non-existent'}) self.assertEqual([], view.entries) self.assertEqual([], view.opening_entries) self.assertEqual([], view.closing_entries) self.assertEqual(self.empty_realization, view.real_accounts) self.assertEqual(self.empty_realization, view.opening_real_accounts) self.assertEqual(self.empty_realization, view.closing_real_accounts)
def tag(tag=None, path=None): return views.TagView(app.entries, app.options, 'Tag {}'.format(tag), set([tag]))