def test_edit(self, run_editor):
        category = self.create_payment_category()
        dialog = PaymentCategoryDialog(self.store, reuse_store=True)

        dialog.list_slave.listcontainer.list.select(category)

        self.click(dialog.list_slave.listcontainer.edit_button)
        run_editor.assert_called_once_with(self.store, category)
    def test_delete(self, yesno):
        category = self.create_payment_category()
        dialog = PaymentCategoryDialog(self.store, reuse_store=True)

        dialog.list_slave.listcontainer.list.select(category)

        yesno.return_value = Gtk.ResponseType.OK
        self.click(dialog.list_slave.listcontainer.remove_button)

        yesno.assert_called_once_with('Do you want to remove category ?',
                                      buttons=((Gtk.STOCK_CANCEL,
                                                Gtk.ResponseType.CANCEL),
                                               (Gtk.STOCK_REMOVE,
                                                Gtk.ResponseType.OK)),
                                      default=Gtk.ResponseType.OK,
                                      parent=None)

        self.check_dialog(dialog, 'payment-category-delete')
    def test_show(self):
        self.create_payment_category()
        dialog = PaymentCategoryDialog(self.store)

        self.check_dialog(dialog, 'payment-category-show')