Ejemplo n.º 1
0
    def __init__(self, app):
        self._loaded = False
        WebView.__init__(self)
        self.app = app
        self.get_view().connect('load-changed', self._on_view__document_load_changed)

        self._load_user_settings()
Ejemplo n.º 2
0
    def test_dialog_payment_details(self, new_store, run_dialog):
        new_store.return_value = self.store

        payment = self.create_payment()
        web_view = WebView()
        web_view.app = None
        with mock.patch.object(self.store, 'commit'):
            with mock.patch.object(self.store, 'close'):
                web_view._dialog_payment_details(id=payment.id)
Ejemplo n.º 3
0
 def test_dialog_call(self, new_store, run_dialog):
     new_store.return_value = self.store
     call = self.create_call()
     web_view = WebView()
     web_view.app = None
     with mock.patch.object(self.store, 'commit'):
         with mock.patch.object(self.store, 'close'):
             web_view._dialog_call(id=call.id)
             run_dialog.assert_called_once_with(CallsEditor, None,
                                                self.store, call, None,
                                                None)
Ejemplo n.º 4
0
    def test_dialog_purchase(self, new_store, run_dialog):
        new_store.return_value = self.store

        purchase = self.create_purchase_order()
        web_view = WebView()
        web_view.app = None
        with mock.patch.object(self.store, 'commit'):
            with mock.patch.object(self.store, 'close'):
                web_view._dialog_purchase(id=purchase.id)
                run_dialog.assert_called_once_with(PurchaseDetailsDialog, None,
                                                   self.store, purchase)
Ejemplo n.º 5
0
    def test_dialog_work_order(self, new_store, run_dialog):
        new_store.return_value = self.store

        wo = self.create_workorder()
        web_view = WebView()
        web_view.app = None
        with mock.patch.object(self.store, 'commit'):
            with mock.patch.object(self.store, 'close'):
                web_view._dialog_work_order(id=wo.id)
                run_dialog.assert_called_once_with(WorkOrderEditor,
                                                   None,
                                                   self.store,
                                                   wo,
                                                   visual_mode=False)
Ejemplo n.º 6
0
 def test_show_out_payments_by_date(self):
     web_view = WebView()
     web_view.app = mock.Mock()
     web_view._show_out_payments_by_date('2013-1-1')
     web_view.app.window.run_application.assert_called_once_with(
         u'payable', refresh=False)
Ejemplo n.º 7
0
 def test_show_work_orders_by_date(self):
     web_view = WebView()
     web_view.app = mock.Mock()
     web_view._show_work_orders_by_date('2013-1-1')
     web_view.app.window.run_application.assert_called_once_with(
         u'services', refresh=False)