def test_create_category(self): category = PaymentCategory(store=self.store, name=u'TestCategory', category_type=PaymentCategory.TYPE_RECEIVABLE) editor = InPaymentEditor(self.store, category=category.name) self.check_editor(editor, 'editor-in-payment-create-with-category')
def create_model(self, store): used_colors = set([pc.color for pc in store.find(PaymentCategory)]) color = get_random_color(ignore=used_colors) return PaymentCategory(name=u'', color=color, category_type=int(self._category_type), store=store)
def create_payment_category(self, name=u'category', category_type=None): from stoqlib.domain.payment.category import PaymentCategory return PaymentCategory(name=name, color=u'#ff0000', store=self.store, category_type=category_type or PaymentCategory.TYPE_PAYABLE)