[POS-commit] r6329 - in stoqlib/trunk/stoqlib/domain: . test

Johan Dahlin jdahlin at async.com.br
Thu Apr 5 11:30:01 BRT 2007


Author: jdahlin
Date: Thu Apr  5 11:30:01 2007
New Revision: 6329

Modified:
   stoqlib/trunk/stoqlib/domain/exampledata.py
   stoqlib/trunk/stoqlib/domain/test/domaintest.py

Log:
Simplify example creation by making all methods public in ExampleCreator and inherit from it in DomainTest

Modified: stoqlib/trunk/stoqlib/domain/exampledata.py
==============================================================================
--- stoqlib/trunk/stoqlib/domain/exampledata.py	(original)
+++ stoqlib/trunk/stoqlib/domain/exampledata.py	Thu Apr  5 11:30:01 2007
@@ -118,59 +118,59 @@
 
     def create_by_type(self, model_type):
         known_types = {
-            'APaymentMethod': self._create_payment_method,
-            'ASellable': self._create_sellable,
-            'AbstractFiscalBookEntry' : self._create_abstract_fiscal_book_entry,
-            'AbstractPaymentGroup' : self._create_payment_group,
-            'BaseSellableInfo': self._create_base_sellable_info,
+            'APaymentMethod': self.create_payment_method,
+            'ASellable': self.create_sellable,
+            'AbstractFiscalBookEntry' : self.create_abstract_fiscal_book_entry,
+            'AbstractPaymentGroup' : self.create_payment_group,
+            'BaseSellableInfo': self.create_base_sellable_info,
             'BranchStation': self.get_station,
-            'Bank': self._create_bank,
+            'Bank': self.create_bank,
             'CityLocation': self.get_location,
-            'CfopData': self._create_cfop_data,
-            'CouponPrinter': self._create_coupon_printer,
-            'DeviceConstant': self._create_device_constant,
-            'DeviceSettings': self._create_device_settings,
-            'EmployeeRole': self._create_employee_role,
-            'IcmsIpiBookEntry': self._create_icms_ipi_book_entry,
-            'IssBookEntry': self._create_iss_book_entry,
-            'IClient': self._create_client,
-            'IBranch': self._create_branch,
-            'IEmployee': self._create_employee,
-            'IIndividual': self._create_individual,
-            'ISalesPerson': self._create_sales_person,
-            'ISupplier': self._create_supplier,
-            'ITransporter': self._create_transporter,
-            'IUser': self._create_user,
-            'OnSaleInfo': self._create_on_sale_info,
-            'Payment': self._create_payment,
-            'PaymentDestination' : self._create_payment_destination,
-            'ParameterData': self._create_parameter_data,
-            'Person': self._create_person,
-            'PersonAdaptToBankBranch': self._create_bank_branch,
-            'PersonAdaptToBranch': self._create_branch,
-            '_PersonAdaptToCompany': self._create_company,
-            'PersonAdaptToClient': self._create_client,
-            'PersonAdaptToCreditProvider': self._create_credit_provider,
-            'PersonAdaptToEmployee': self._create_employee,
-            '_PersonAdaptToIndividual': self._create_individual,
-            'PersonAdaptToSalesPerson': self._create_sales_person,
-            'PersonAdaptToSupplier': self._create_supplier,
-            'PersonAdaptToTransporter': self._create_transporter,
-            'PersonAdaptToUser': self._create_user,
-            'Product': self._create_product,
-            'ProductAdaptToSellable' : self._create_sellable,
-            'ProductAdaptToStorable' : self._create_storable,
-            'ProductSellableItem': self._create_product_sellable_item,
-            'PurchaseOrder' : self._create_purchase_order,
-            'PurchaseItem' : self._create_purchase_order_item,
-            'ReceivingOrder' : self._create_receiving_order,
-            'ReceivingOrderItem' : self._create_receiving_order_item,
-            'RenegotiationData' : self._create_renegotiation_data,
-            'Sale': self._create_sale,
-            'Service': self._create_service,
-            'ServiceSellableItem': self._create_service_sellable_item,
-            'Till': self._create_till,
-            'UserProfile': self._create_user_profile,
+            'CfopData': self.create_cfop_data,
+            'CouponPrinter': self.create_coupon_printer,
+            'DeviceConstant': self.create_device_constant,
+            'DeviceSettings': self.create_device_settings,
+            'EmployeeRole': self.create_employee_role,
+            'IcmsIpiBookEntry': self.create_icms_ipi_book_entry,
+            'IssBookEntry': self.create_iss_book_entry,
+            'IClient': self.create_client,
+            'IBranch': self.create_branch,
+            'IEmployee': self.create_employee,
+            'IIndividual': self.create_individual,
+            'ISalesPerson': self.create_sales_person,
+            'ISupplier': self.create_supplier,
+            'ITransporter': self.create_transporter,
+            'IUser': self.create_user,
+            'OnSaleInfo': self.create_on_sale_info,
+            'Payment': self.create_payment,
+            'PaymentDestination' : self.create_payment_destination,
+            'ParameterData': self.create_parameter_data,
+            'Person': self.create_person,
+            'PersonAdaptToBankBranch': self.create_bank_branch,
+            'PersonAdaptToBranch': self.create_branch,
+            '_PersonAdaptToCompany': self.create_company,
+            'PersonAdaptToClient': self.create_client,
+            'PersonAdaptToCreditProvider': self.create_credit_provider,
+            'PersonAdaptToEmployee': self.create_employee,
+            '_PersonAdaptToIndividual': self.create_individual,
+            'PersonAdaptToSalesPerson': self.create_sales_person,
+            'PersonAdaptToSupplier': self.create_supplier,
+            'PersonAdaptToTransporter': self.create_transporter,
+            'PersonAdaptToUser': self.create_user,
+            'Product': self.create_product,
+            'ProductAdaptToSellable' : self.create_sellable,
+            'ProductAdaptToStorable' : self.create_storable,
+            'ProductSellableItem': self.create_product_sellable_item,
+            'PurchaseOrder' : self.create_purchase_order,
+            'PurchaseItem' : self.create_purchase_order_item,
+            'ReceivingOrder' : self.create_receiving_order,
+            'ReceivingOrderItem' : self.create_receiving_order_item,
+            'RenegotiationData' : self.create_renegotiation_data,
+            'Sale': self.create_sale,
+            'Service': self.create_service,
+            'ServiceSellableItem': self.create_service_sellable_item,
+            'Till': self.create_till,
+            'UserProfile': self.create_user_profile,
             }
         if isinstance(model_type, basestring):
             model_name = model_type
@@ -179,109 +179,107 @@
         if model_name in known_types:
             return known_types[model_name]()
 
-    # Private
-
-    def _create_person(self):
+    def create_person(self):
         from stoqlib.domain.person import Person
         return Person(name='John', connection=self.trans)
 
-    def _create_branch(self):
+    def create_branch(self):
         from stoqlib.domain.person import Person
         person = Person(name='Dummy', connection=self.trans)
         person.addFacet(ICompany, fancy_name='Dummy shop',
                         connection=self.trans)
         return person.addFacet(IBranch, connection=self.trans)
 
-    def _create_supplier(self):
+    def create_supplier(self):
         from stoqlib.domain.person import Person
         person = Person(name='Supplier', connection=self.trans)
         person.addFacet(ICompany, fancy_name='Company Name',
                         connection=self.trans)
         return person.addFacet(ISupplier, connection=self.trans)
 
-    def _create_employee_role(self):
+    def create_employee_role(self):
         from stoqlib.domain.person import EmployeeRole
         return EmployeeRole(name='Role', connection=self.trans)
 
-    def _create_employee(self):
+    def create_employee(self):
         from stoqlib.domain.person import Person
         person = Person(name='SalesPerson', connection=self.trans)
         person.addFacet(IIndividual, connection=self.trans)
         return person.addFacet(IEmployee,
-                               role=self._create_employee,
+                               role=self.create_employee,
                                connection=self.trans)
 
-    def _create_sales_person(self):
-        employee = self._create_employee()
+    def create_sales_person(self):
+        employee = self.create_employee()
         return employee.person.addFacet(ISalesPerson, connection=self.trans)
 
-    def _create_client(self):
+    def create_client(self):
         from stoqlib.domain.person import Person
         person = Person(name='Client', connection=self.trans)
         person.addFacet(IIndividual, connection=self.trans)
         return person.addFacet(IClient, connection=self.trans)
 
-    def _create_individual(self):
+    def create_individual(self):
         from stoqlib.domain.person import Person
         person = Person(name='individual', connection=self.trans)
         return person.addFacet(IIndividual, connection=self.trans)
 
-    def _create_user(self):
-        individual = self._create_individual()
-        profile = self._create_user_profile()
+    def create_user(self):
+        individual = self.create_individual()
+        profile = self.create_user_profile()
         return individual.person.addFacet(IUser, username='username',
                                           password='password',
                                           profile=profile,
                                           connection=self.trans)
 
-    def _create_storable(self):
+    def create_storable(self):
         from stoqlib.domain.product import Product
         product = Product(connection=self.trans)
         return product.addFacet(IStorable, connection=self.trans)
 
-    def _create_product(self):
+    def create_product(self):
         from stoqlib.domain.product import ProductSupplierInfo
-        sellable = self._create_sellable()
+        sellable = self.create_sellable()
         product = sellable.get_adapted()
         ProductSupplierInfo(connection=self.trans,
-                            supplier=self._create_supplier(),
+                            supplier=self.create_supplier(),
                             product=product, is_main_supplier=True)
         return product
 
-    def _create_product_sellable_item(self):
+    def create_product_sellable_item(self):
         from stoqlib.domain.service import ProductSellableItem
-        sale = self._create_sale()
-        sellable = self._create_sellable()
+        sale = self.create_sale()
+        sellable = self.create_sellable()
         return ProductSellableItem(
             sellable=sellable,
             quantity=1, price=10,
             sale=sale, connection=self.trans)
 
-    def _create_base_sellable_info(self):
+    def create_base_sellable_info(self):
         from stoqlib.domain.sellable import BaseSellableInfo
         return BaseSellableInfo(connection=self.trans,
                                 description="Description",
                                 price=10)
 
-    def _create_sellable(self):
+    def create_sellable(self):
         from stoqlib.domain.product import Product
         product = Product(connection=self.trans)
         tax_constant = sysparam(self.trans).DEFAULT_PRODUCT_TAX_CONSTANT
-        base_sellable_info = self._create_base_sellable_info()
-        on_sale_info = self._create_on_sale_info()
+        base_sellable_info = self.create_base_sellable_info()
+        on_sale_info = self.create_on_sale_info()
         return product.addFacet(ISellable,
                                 tax_constant=tax_constant,
                                 base_sellable_info=base_sellable_info,
                                 on_sale_info=on_sale_info,
                                 connection=self.trans)
-    def _create_sale(self):
+    def create_sale(self):
         from stoqlib.domain.sale import Sale
         from stoqlib.domain.till import Till
         till = Till.get_current(self.trans)
         if till is None:
-            till = self._create_till()
+            till = self.create_till()
             till.open_till()
-        salesperson = self._create_sales_person()
+        salesperson = self.create_sales_person()
         return Sale(till=till,
                     coupon_id=0,
                     open_date=datetime.datetime.now(),
@@ -289,29 +287,29 @@
                     cfop=sysparam(self.trans).DEFAULT_SALES_CFOP,
                     connection=self.trans)
 
-    def _create_city_location(self):
+    def create_city_location(self):
         from stoqlib.domain.address import CityLocation
         return CityLocation(country='Groenlandia',
                             city='Acapulco',
                             state='Wisconsin',
                             connection=self.trans)
 
-    def _create_parameter_data(self):
+    def create_parameter_data(self):
         from stoqlib.domain.parameter import ParameterData
         return ParameterData.select(connection=self.trans)[0]
 
-    def _create_service_sellable_item(self):
+    def create_service_sellable_item(self):
         from stoqlib.domain.service import ServiceSellableItem
-        sale = self._create_sale()
-        sellable = self._create_sellable()
+        sale = self.create_sale()
+        sellable = self.create_sellable()
         return ServiceSellableItem(
             sellable=sellable,
             quantity=1, price=10,
             sale=sale, connection=self.trans)
 
-    def _create_device_constant(self):
+    def create_device_constant(self):
         from stoqlib.domain.devices import DeviceConstant
-        settings = self._create_device_settings()
+        settings = self.create_device_settings()
         return DeviceConstant(constant_name="Fake Tax Constant",
                               constant_type=DeviceConstant.TYPE_TAX,
                               constant_enum=int(TaxType.CUSTOM),
@@ -320,107 +318,107 @@
                               device_settings=settings,
                               connection=self.trans)
 
-    def _create_device_settings(self):
+    def create_device_settings(self):
         from stoqlib.drivers.fiscalprinter import (
                 get_fiscal_printer_settings_by_station)
 
         station = get_current_station(self.trans)
         return get_fiscal_printer_settings_by_station(self.trans, station)
 
-    def _create_company(self):
+    def create_company(self):
         from stoqlib.domain.person import Person
         person = Person(name='Dummy', connection=self.trans)
         return person.addFacet(ICompany, fancy_name='Dummy shop',
                                connection=self.trans)
 
-    def _create_till(self):
+    def create_till(self):
         from stoqlib.domain.till import Till
         station = get_current_station(self.trans)
         return Till(connection=self.trans, station=station)
 
-    def _create_user_profile(self):
+    def create_user_profile(self):
         from stoqlib.domain.profile import UserProfile
         return UserProfile(connection=self.trans, name='assistant')
 
-    def _create_purchase_order(self):
+    def create_purchase_order(self):
         from stoqlib.domain.purchase import PurchaseOrder
-        order = PurchaseOrder(supplier=self._create_supplier(),
-                              branch=self._create_branch(),
+        order = PurchaseOrder(supplier=self.create_supplier(),
+                              branch=self.create_branch(),
                             connection=self.trans)
         order.addFacet(IPaymentGroup, connection=self.trans)
         return order
 
-    def _create_purchase_order_item(self):
+    def create_purchase_order_item(self):
         from stoqlib.domain.purchase import PurchaseItem
         return PurchaseItem(connection=self.trans,
                             quantity=8, quantity_received=3,
                             cost=125, base_cost=125,
-                            sellable=self._create_sellable(),
-                            order=self._create_purchase_order())
+                            sellable=self.create_sellable(),
+                            order=self.create_purchase_order())
 
-    def _create_cfop_data(self):
+    def create_cfop_data(self):
         from stoqlib.domain.fiscal import CfopData
         return CfopData(connection=self.trans, code=u'123',
                         description=u'test')
 
-    def _create_receiving_order(self):
+    def create_receiving_order(self):
         from stoqlib.domain.receiving import ReceivingOrder
-        purchase = self._create_purchase_order()
+        purchase = self.create_purchase_order()
         return ReceivingOrder(connection=self.trans,
                               invoice_number=222,
                               supplier=purchase.supplier,
-                              responsible=self._create_user(),
+                              responsible=self.create_user(),
                               purchase=purchase,
-                              branch=self._create_branch(),
-                              cfop=self._create_cfop_data())
+                              branch=self.create_branch(),
+                              cfop=self.create_cfop_data())
 
-    def _create_receiving_order_item(self):
+    def create_receiving_order_item(self):
         from stoqlib.domain.receiving import ReceivingOrderItem
-        receiving_order = self._create_receiving_order()
-        purchase_item = self._create_purchase_order_item()
+        receiving_order = self.create_receiving_order()
+        purchase_item = self.create_purchase_order_item()
         return ReceivingOrderItem(connection=self.trans,
                                   quantity=8, cost=125,
                                   purchase_item=purchase_item,
                                   sellable=purchase_item.sellable,
                                   receiving_order=receiving_order)
 
-    def _create_icms_ipi_book_entry(self):
+    def create_icms_ipi_book_entry(self):
         from stoqlib.domain.fiscal import IcmsIpiBookEntry
         from stoqlib.domain.payment.payment import AbstractPaymentGroup
         payment_group = AbstractPaymentGroup(connection=self.trans)
         return IcmsIpiBookEntry(connection=self.trans,
-                                cfop=self._create_cfop_data(),
-                                branch=self._create_branch(),
-                                drawee=self._create_person(),
+                                cfop=self.create_cfop_data(),
+                                branch=self.create_branch(),
+                                drawee=self.create_person(),
                                 payment_group=payment_group,
                                 icms_value=10, ipi_value=10,
                                 invoice_number=200)
 
-    def _create_iss_book_entry(self):
+    def create_iss_book_entry(self):
         from stoqlib.domain.payment.payment import AbstractPaymentGroup
         from stoqlib.domain.fiscal import IssBookEntry
-        cfop = self._create_cfop_data()
-        branch = self._create_branch()
-        drawee = self._create_person()
+        cfop = self.create_cfop_data()
+        branch = self.create_branch()
+        drawee = self.create_person()
         payment_group = AbstractPaymentGroup(connection=self.trans)
         return IssBookEntry(connection=self.trans, cfop=cfop,
                             branch=branch,drawee=drawee,
                             payment_group=payment_group,
                             iss_value=10, invoice_number=201)
 
-    def _create_abstract_fiscal_book_entry(self):
+    def create_abstract_fiscal_book_entry(self):
         from stoqlib.domain.payment.payment import AbstractPaymentGroup
         from stoqlib.domain.fiscal import AbstractFiscalBookEntry
-        cfop = self._create_cfop_data()
-        branch = self._create_branch()
-        drawee = self._create_person()
+        cfop = self.create_cfop_data()
+        branch = self.create_branch()
+        drawee = self.create_person()
         payment_group = AbstractPaymentGroup(connection=self.trans)
         return AbstractFiscalBookEntry(invoice_number=2, cfop=cfop,
                                        branch=branch, drawee=drawee,
                                        payment_group=payment_group,
                                        connection=self.trans)
 
-    def _create_coupon_printer(self):
+    def create_coupon_printer(self):
         from stoqlib.domain.devices import DeviceSettings
         from stoqlib.drivers.fiscalprinter import CouponPrinter
         settings = DeviceSettings(station=get_current_station(self.trans),
@@ -432,11 +430,11 @@
         settings.create_fiscal_printer_constants()
         return CouponPrinter(settings.get_interface(), settings)
 
-    def _create_service(self):
+    def create_service(self):
         from stoqlib.domain.sellable import SellableTaxConstant
         from stoqlib.domain.service import Service
         service = Service(connection=self.trans)
-        sellable_info = self._create_base_sellable_info()
+        sellable_info = self.create_base_sellable_info()
         tax_constant = SellableTaxConstant.get_by_type(
             TaxType.SERVICE, self.trans)
         service.addFacet(ISellable,
@@ -445,63 +443,63 @@
                          connection=self.trans)
         return service
 
-    def _create_renegotiation_data(self):
+    def create_renegotiation_data(self):
         from stoqlib.domain.renegotiation import RenegotiationData
-        person = self._create_person()
+        person = self.create_person()
         return RenegotiationData(connection=self.trans,
                                  paid_total=10,
                                  invoice_number=None,
                                  responsible=person)
 
-    def _create_transporter(self):
-        person = self._create_person()
+    def create_transporter(self):
+        person = self.create_person()
         person.addFacet(ICompany, connection=self.trans)
         return person.addFacet(ITransporter, connection=self.trans)
 
-    def _create_bank(self):
+    def create_bank(self):
         from stoqlib.domain.account import Bank
         return Bank(connection=self.trans, name='Boston', short_name='short',
                     compensation_code='1234')
 
-    def _create_bank_branch(self):
-        person = self._create_person()
+    def create_bank_branch(self):
+        person = self.create_person()
         person.addFacet(ICompany, connection=self.trans)
         return person.addFacet(IBankBranch, connection=self.trans,
-                               bank=self._create_bank())
+                               bank=self.create_bank())
 
-    def _create_credit_provider(self):
-        person = self._create_person()
+    def create_credit_provider(self):
+        person = self.create_person()
         person.addFacet(ICompany, connection=self.trans)
         return  person.addFacet(ICreditProvider,
                                 connection=self.trans,
                                 short_name='Velec',
                                 open_contract_date=datetime.date(2006, 01, 01))
 
-    def _create_payment_method(self):
+    def create_payment_method(self):
         from stoqdrivers.enum import PaymentMethodType
         from stoqlib.domain.payment.methods import APaymentMethod
         return APaymentMethod.get_by_enum(self.trans, PaymentMethodType.MONEY)
 
-    def _create_payment(self):
+    def create_payment(self):
         from stoqlib.domain.payment.payment import Payment
         return Payment(group=None,
                        due_date=None,
                        destination=None,
                        value=Decimal(10),
                        till=None,
-                       method=self._create_payment_method(),
+                       method=self.create_payment_method(),
                        connection=self.trans)
 
-    def _create_payment_group(self):
+    def create_payment_group(self):
         from stoqlib.domain.payment.payment import AbstractPaymentGroup
         return AbstractPaymentGroup(connection=self.trans)
 
-    def _create_payment_destination(self):
+    def create_payment_destination(self):
         from stoqlib.domain.payment.destination import PaymentDestination
         return PaymentDestination(description='foobar',
                                   connection=self.trans)
 
-    def _create_on_sale_info(self):
+    def create_on_sale_info(self):
         from stoqlib.domain.sellable import OnSaleInfo
         return OnSaleInfo(connection=self.trans)
 
@@ -512,3 +510,5 @@
         from stoqlib.domain.address import CityLocation
         return CityLocation.get_default(self.trans)
 
+
+

Modified: stoqlib/trunk/stoqlib/domain/test/domaintest.py
==============================================================================
--- stoqlib/trunk/stoqlib/domain/test/domaintest.py	(original)
+++ stoqlib/trunk/stoqlib/domain/test/domaintest.py	Thu Apr  5 11:30:01 2007
@@ -32,151 +32,14 @@
 except:
     import unittest
 
-class DomainTest(unittest.TestCase):
+
+class DomainTest(unittest.TestCase, ExampleCreator):
     def setUp(self):
         self.trans = new_transaction()
 
     def tearDown(self):
         self.trans.rollback()
 
-    def create_person(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('Person')
-
-    def create_branch(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('IBranch')
-
-    def create_supplier(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('ISupplier')
-
-    def create_employee(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('IEmployee')
-
-    def create_salesperson(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('ISalesPerson')
-
-    def create_client(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('IClient')
-
-    def create_individual(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('IIndividual')
-
-    def create_user(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('IUser')
-
-    def create_storable(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('ProductAdaptToStorable')
-
-    def create_product(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('Product')
-
-    def create_sellable(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('ProductAdaptToSellable')
-
-    def create_sale(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('Sale')
-
-    def create_city_location(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('CityLocation')
-
-    def create_parameter_data(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('ParameterData')
-
-    def create_service_sellable_item(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('ServiceSellableItem')
-
-    def create_device_settings(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('DeviceSettings')
-
-    def create_company(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('ICompany')
-
-    def create_till(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('Till')
-
-    def create_user_profile(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('UserProfile')
-
-    def create_device_settings(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('DeviceSettings')
-
-    def create_device_constant(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('DeviceConstant')
-
-    def create_receiving_order(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('ReceivingOrder')
-
-    def create_receiving_order_item(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('ReceivingOrderItem')
-
-    def create_icms_ipi_book_entry(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('IcmsIpiBookEntry')
-
-    def create_iss_book_entry(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('IssBookEntry')
-
-    def create_abstract_fiscal_book_entry(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('AbstractFiscalBookEntry')
-
-    def create_coupon_printer(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('CouponPrinter')
-
-    def create_service(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('Service')
-
-    def create_transporter(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('ITransporter')
-
-    def create_employee_role(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('EmployeeRole')
-
-    def create_sales_person(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('PersonAdaptToSalesPerson')
-
-    def create_purchase_order(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('PurchaseOrder')
-
-    def get_station(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('BranchStation')
-
-    def get_location(self):
-        ex = ExampleCreator(self.trans)
-        return ex.create_by_type('CityLocation')
-
-    def create_by_type(self, model_type):
-        return ExampleCreator(self.trans).create_by_type(model_type)
 
 # Ensure that the database settings and etc are available for all
 # the domain tests


More information about the POS-commit mailing list