コード例 #1
0
    def test_add_account(self, run_dialog, new_store):
        new_account = self.create_account()
        new_store.return_value = self.store
        run_dialog.return_value = new_account
        editor = AccountTransactionEditor(self.store, None, new_account)
        parent_account = editor._get_account()

        with mock.patch.object(self.store, 'commit'):
            with mock.patch.object(self.store, 'close'):
                self.click(editor.add_account)
                run_dialog.assert_called_once_with(AccountEditor, editor, self.store, parent_account=parent_account)
コード例 #2
0
    def test_add_account(self, run_dialog, new_store):
        new_account = self.create_account()
        new_store.return_value = self.store
        run_dialog.return_value = new_account
        editor = AccountTransactionEditor(self.store, None, new_account)
        parent_account = editor._get_account()

        with mock.patch.object(self.store, 'commit'):
            with mock.patch.object(self.store, 'close'):
                self.click(editor.add_account)
                run_dialog.assert_called_once_with(
                    AccountEditor,
                    editor,
                    self.store,
                    parent_account=parent_account)