[Erp5-report] r45066 lucas - in /erp5/trunk/bt5/erp5_configurator_standard: TestTemplateIte...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Apr 4 20:02:42 CEST 2011


Author: lucas
Date: Mon Apr  4 20:02:42 2011
New Revision: 45066

URL: http://svn.erp5.org?rev=45066&view=rev
Log:
2011-04-01 lucas
* Added new tests to check Purchase Trade Condition and Sale Trande Condition.

Modified:
    erp5/trunk/bt5/erp5_configurator_standard/TestTemplateItem/testStandardConfigurationWorkflow.py
    erp5/trunk/bt5/erp5_configurator_standard/bt/change_log
    erp5/trunk/bt5/erp5_configurator_standard/bt/revision

Modified: erp5/trunk/bt5/erp5_configurator_standard/TestTemplateItem/testStandardConfigurationWorkflow.py
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_configurator_standard/TestTemplateItem/testStandardConfigurationWorkflow.py?rev=45066&r1=45065&r2=45066&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_configurator_standard/TestTemplateItem/testStandardConfigurationWorkflow.py [utf8] (original)
+++ erp5/trunk/bt5/erp5_configurator_standard/TestTemplateItem/testStandardConfigurationWorkflow.py [utf8] Mon Apr  4 20:02:42 2011
@@ -1006,6 +1006,97 @@ class TestStandardConfiguratorWorkflow(T
 
           self.assertEquals(object.showDict().get(property_name), v)
 
+  def stepCheckSaleTradeCondition(self, sequence=None, sequence_list=None, **kw):
+    """
+      Check if Sale Trade Condition object has been created.
+    """
+    business_configuration = sequence.get('business_configuration')
+    sale_trade_condition_list = \
+                self.getBusinessConfigurationObjectList(business_configuration,
+                                                        'Sale Trade Condition')
+    self.assertEquals(len(sale_trade_condition_list), 1)
+    sale_trade_condition = sale_trade_condition_list[0]
+
+    self.assertEquals("General Sale Trade Condition",
+                                              sale_trade_condition.getTitle())
+    self.assertEquals("STC-General", sale_trade_condition.getReference())
+
+    self.assertNotEquals(None, sale_trade_condition.getEffectiveDate())
+    self.assertNotEquals(None, sale_trade_condition.getExpirationDate())
+
+    # Check relation with Business Process
+    business_process_list = \
+               self.getBusinessConfigurationObjectList(business_configuration,
+                                                            'Business Process')
+    self.assertEquals(len(business_process_list), 1)
+    business_process = business_process_list[0]
+    self.assertEquals(business_process,
+                                    sale_trade_condition.getSpecialiseValue())
+
+    # Check relation with Organisation
+    organisation_list = \
+                self.getBusinessConfigurationObjectList(business_configuration,
+                                                                'Organisation')
+    organisation = organisation_list[0]
+
+    self.assertEquals(organisation, sale_trade_condition.getSourceValue())
+    self.assertEquals(organisation,
+                                  sale_trade_condition.getSourceSectionValue())
+
+    # Check relation with Currency
+    currency_list = \
+                self.getBusinessConfigurationObjectList(business_configuration,
+                                                                    'Currency')
+    currency = currency_list[0]
+    self.assertEquals(currency.getRelativeUrl(),
+                                       sale_trade_condition.getPriceCurrency())
+
+  def stepCheckPurchaseTradeCondition(self, sequence=None, sequence_list=None, **kw):
+    """
+      Check if Purchase Trade Condition object has been created.
+    """
+    business_configuration = sequence.get('business_configuration')
+    purchase_trade_condition_list = \
+                self.getBusinessConfigurationObjectList(business_configuration,
+                                                        'Purchase Trade Condition')
+    self.assertEquals(len(purchase_trade_condition_list), 1)
+    purchase_trade_condition = purchase_trade_condition_list[0]
+
+    self.assertEquals("General Purchase Trade Condition",
+                                              purchase_trade_condition.getTitle())
+    self.assertEquals("PTC-General", purchase_trade_condition.getReference())
+
+    self.assertNotEquals(None, purchase_trade_condition.getEffectiveDate())
+    self.assertNotEquals(None, purchase_trade_condition.getExpirationDate())
+
+    # Check relation with Business Process
+    business_process_list = \
+               self.getBusinessConfigurationObjectList(business_configuration,
+                                                            'Business Process')
+    self.assertEquals(len(business_process_list), 1)
+    business_process = business_process_list[0]
+    self.assertEquals(business_process,
+                                    purchase_trade_condition.getSpecialiseValue())
+
+    # Check relation with Organisation
+    organisation_list = \
+                self.getBusinessConfigurationObjectList(business_configuration,
+                                                                'Organisation')
+    organisation = organisation_list[0]
+
+    self.assertEquals(organisation,
+                               purchase_trade_condition.getDestinationValue())
+    self.assertEquals(organisation,
+                        purchase_trade_condition.getDestinationSectionValue())
+
+    # Check relation with Currency
+    currency_list = \
+                self.getBusinessConfigurationObjectList(business_configuration,
+                                                                    'Currency')
+    currency = currency_list[0]
+    self.assertEquals(currency.getRelativeUrl(),
+                                       purchase_trade_condition.getPriceCurrency())
+
   @expectedFailure
   def stepCheckQuantityConversion(self, sequence=None, sequence_list=None, **kw):
     resource = self.portal.product_module.newContent(
@@ -1156,6 +1247,8 @@ class TestStandardConfiguratorWorkflow(T
       stepCheckRuleValidation
       stepCheckBusinessProcess
       stepCheckSolver
+      stepCheckSaleTradeCondition
+      stepCheckPurchaseTradeCondition
       """
     # XXX (lucas): expected failure, it must be fixed in ERP5 core.
     #sequence_string += """

Modified: erp5/trunk/bt5/erp5_configurator_standard/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_configurator_standard/bt/change_log?rev=45066&r1=45065&r2=45066&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_configurator_standard/bt/change_log [utf8] (original)
+++ erp5/trunk/bt5/erp5_configurator_standard/bt/change_log [utf8] Mon Apr  4 20:02:42 2011
@@ -1,4 +1,7 @@
 2011-04-01 lucas
+* Added new tests to check Purchase Trade Condition and Sale Trande Condition.
+
+2011-04-01 lucas
 * Renamed  module_permission_access.ods to standard_module_permission_access.ods
 
 2011-04-01 lucas

Modified: erp5/trunk/bt5/erp5_configurator_standard/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_configurator_standard/bt/revision?rev=45066&r1=45065&r2=45066&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_configurator_standard/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_configurator_standard/bt/revision [utf8] Mon Apr  4 20:02:42 2011
@@ -1 +1 @@
-598
\ No newline at end of file
+599
\ No newline at end of file



More information about the Erp5-report mailing list