def test_confirm(self, warning): editor = CashInEditor(self.store) self.assertNotSensitive(editor.main_dialog, ['ok_button']) editor.cash_slave.proxy.update('value', currency(10)) self.assertSensitive(editor.main_dialog, ['ok_button']) TillAddCashEvent.connect(_till_event) editor.confirm() self.assertEqual(editor.retval, False) warning.assert_called_once_with("ERROR") TillAddCashEvent.disconnect(_till_event) editor.confirm() self.assertEqual(editor.retval, editor.model)
def testConfirm(self, warning): editor = CashInEditor(self.store) self.assertNotSensitive(editor.main_dialog, ['ok_button']) editor.cash_slave.proxy.update('value', currency(10)) self.assertSensitive(editor.main_dialog, ['ok_button']) TillAddCashEvent.connect(_till_event) editor.confirm() self.assertEqual(editor.retval, False) warning.assert_called_once_with("ERROR") TillAddCashEvent.disconnect(_till_event) editor.confirm() self.assertEqual(editor.retval, editor.model)