Exemplo n.º 1
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_purchase(id=call.id)
Exemplo 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)
Exemplo 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)
Exemplo n.º 4
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)
Exemplo n.º 5
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)
Exemplo n.º 6
0
    def __init__(self):
        self._js_data = None
        self._js_options = None
        self._current = None

        gtk.Window.__init__(self)
        self.set_size_request(800, 480)

        self.vbox = gtk.VBox()
        self.add(self.vbox)
        self.vbox.show()

        hbox = gtk.HBox()
        self.vbox.pack_start(hbox, False, False, 6)
        hbox.show()

        label = gtk.Label('Period:')
        hbox.pack_start(label, False, False, 6)
        label.show()

        self.chart_type = ProxyComboBox()
        self.chart_type.connect('content-changed',
                                self._on_chart_type__content_changed)
        hbox.pack_start(self.chart_type, False, False, 6)
        self.chart_type.show()

        self.period_values = ProxyComboBox()
        self.period_values.connect('content-changed',
                                   self._on_period_values__content_changed)
        hbox.pack_start(self.period_values, False, False, 6)
        self.period_values.show()

        self._view = WebView()
        self._view.get_view().connect('load-finished',
                                      self._on_view__document_load_finished)
        self.vbox.pack_start(self._view, True, True)

        self.results = ObjectList()
        self.results.connect('row-activated', self._on_results__row_activated)
        self.vbox.pack_start(self.results, True, True)

        self._setup_daemon()
Exemplo n.º 7
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)
Exemplo n.º 8
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)