def test_confirm(self, warning): # Add some amount to till so it can be removed above p = self.create_payment(payment_type=Payment.TYPE_IN, value=currency(50)) self.till.add_entry(p) editor = CashOutEditor(self.store) self.assertNotSensitive(editor.main_dialog, ["ok_button"]) editor.cash_slave.proxy.update("value", currency(10)) self.assertSensitive(editor.main_dialog, ["ok_button"]) TillRemoveCashEvent.connect(_till_event) editor.confirm() self.assertEqual(editor.retval, False) warning.assert_called_once_with("ERROR") TillRemoveCashEvent.disconnect(_till_event) editor.confirm() self.assertEqual(editor.retval, editor.model)
def test_confirm(self, warning): # Add some amount to till so it can be removed above p = self.create_payment(payment_type=Payment.TYPE_IN, value=currency(50)) self.till.add_entry(p) editor = CashOutEditor(self.store) self.assertNotSensitive(editor.main_dialog, ['ok_button']) editor.cash_slave.proxy.update('value', currency(10)) self.assertSensitive(editor.main_dialog, ['ok_button']) TillRemoveCashEvent.connect(_till_event) editor.confirm() self.assertEqual(editor.retval, False) warning.assert_called_once_with("ERROR") TillRemoveCashEvent.disconnect(_till_event) editor.confirm() self.assertEqual(editor.retval, editor.model)
def test_create(self): editor = CashOutEditor(self.store) self.check_editor(editor, 'editor-cashout-create')
def test_create(self): till = self.create_till() till.open_till() editor = CashOutEditor(self.store) self.check_editor(editor, 'editor-cash-out-create')