本文整理汇总了Python中stoqlib.domain.payment.method.PaymentMethod.get_editable_methods方法的典型用法代码示例。如果您正苦于以下问题:Python PaymentMethod.get_editable_methods方法的具体用法?Python PaymentMethod.get_editable_methods怎么用?Python PaymentMethod.get_editable_methods使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stoqlib.domain.payment.method.PaymentMethod
的用法示例。
在下文中一共展示了PaymentMethod.get_editable_methods方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _setup_list
# 需要导入模块: from stoqlib.domain.payment.method import PaymentMethod [as 别名]
# 或者: from stoqlib.domain.payment.method.PaymentMethod import get_editable_methods [as 别名]
def _setup_list(self):
methods = PaymentMethod.get_editable_methods(self.store)
self.klist = ObjectList(self._get_columns(), methods, gtk.SELECTION_BROWSE)
self.klist.connect("selection-changed", self._on_klist__selection_changed)
self.klist.connect("row-activated", self._on_klist__row_activated)
self.klist.connect("cell-edited", self.on_cell_edited)
self.main.remove(self.main.get_child())
self.main.add(self.klist)
self.klist.show()
示例2: testGetEditableMethods
# 需要导入模块: from stoqlib.domain.payment.method import PaymentMethod [as 别名]
# 或者: from stoqlib.domain.payment.method.PaymentMethod import get_editable_methods [as 别名]
def testGetEditableMethods(self):
methods = PaymentMethod.get_editable_methods(self.store)
self.assertTrue(methods)
self.assertEquals(len(methods), 7)
self.assertEquals(methods[0].method_name, u'bill')
self.assertEquals(methods[1].method_name, u'card')
self.assertEquals(methods[2].method_name, u'check')
self.assertEquals(methods[3].method_name, u'deposit')
self.assertEquals(methods[4].method_name, u'money')
self.assertEquals(methods[5].method_name, u'multiple')
self.assertEquals(methods[6].method_name, u'store_credit')
methods_names = [m.method_name for m in methods]
self.assertFalse(u'online' in methods_names)
self.assertFalse(u'trade' in methods_names)