[Erp5-report] r28185 - /erp5/trunk/products/ERP5/tests/testERP5Commerce.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Jul 28 10:40:30 CEST 2009
Author: vincentd
Date: Tue Jul 28 10:40:26 2009
New Revision: 28185
URL: http://svn.erp5.org?rev=28185&view=rev
Log:
Update todo list and add new test to do
Modified:
erp5/trunk/products/ERP5/tests/testERP5Commerce.py
Modified: erp5/trunk/products/ERP5/tests/testERP5Commerce.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testERP5Commerce.py?rev=28185&r1=28184&r2=28185&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5Commerce.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testERP5Commerce.py [utf8] Tue Jul 28 10:40:26 2009
@@ -64,6 +64,22 @@
SaleOrder_finalizeShopping
SaleOrder_getSelectedShippingResource
SaleOrder_isShippingRequired
+ SaleOrder_paymentRedirect
+ WebSection_checkPaypalIdentification
+ WebSection_checkoutProcedure
+ WebSection_doPaypalPayment
+ WebSection_viewCurrentPersonAsWeb
+ WebSite_doExpressCheckoutPayment
+ WebSite_getExpressCheckoutDetails
+ WebSite_getNewPaypalToken
+ WebSite_getPaypalOrderParameterDict
+ WebSite_getPaypalSecurityParameterDict
+ WebSite_getPaypalUrl
+ WebSite_setupECommerceWebSite
+ Product_getRelatedDescription
+ Person_editPersonalInformation (maybe useless to unittest)
+ Resource_getShopUrl
+ WebSection_getProductList
"""
run_all_test = 1
@@ -131,6 +147,51 @@
Get default product.
"""
return self.getPortal().product_module[id]
+
+ def InitialiseShippingLine(self):
+ portal = self.getPortal()
+ euro = portal.currency_module.newContent(portal_type='Currency',
+ id='euro',
+ reference='EUR')
+ euro.setBaseUnitQuantity(1.00)
+ euro.validate()
+
+ category_list = []
+ ldlc = portal.portal_categories.product_line.newContent(portal_type='Category', id='ldlc', title='LDLC')
+ laptop = ldlc.newContent(portal_type='Category', id='laptop', title='Laptop')
+ category_list.append(laptop)
+ netbook = laptop.newContent(portal_type='Category', id='netbook', title='Netbook')
+ category_list.append(netbook)
+ category_list.append(ldlc.newContent(portal_type='Category', id='lcd', title='Lcd Screen'))
+ category_list.append(ldlc.newContent(portal_type='Category', id='mp3', title='Mp3 Player'))
+
+ product_list = []
+ for category in category_list:
+ for i in range(3):
+ product = portal.product_module.newContent(portal_type="Product", title='%s %s' % (category.getTitle(),i), reference='%s_%s' % (category.getId(),i))
+ product.setProductLine(category.getRelativeUrl().replace('product_line/', ''))
+ product.setQuantityUnit('unit/piece')
+ supply_line = product.newContent(id='default_supply_line',portal_type='Supply Line')
+ supply_line.setBasePrice(10 * (i + 1))
+ supply_line.setPricedQuantity(1)
+ supply_line.setDefaultResourceValue(product)
+ supply_line.setPriceCurrency('currency_module/1')
+ product_list.append(product)
+
+ for product in product_list:
+ product.validate()
+
+ ups = portal.product_module.newContent(portal_type='Product',
+ title='UPS Shipping : 24h',
+ )
+ ups.validate()
+ ups.setQuantityUnit('unit/piece')
+ supply_line = ups.setProductLine('shipping/UPS24h')
+ supply_line = ups.newContent(id='default_supply_line',portal_type='Supply Line')
+ supply_line.setBasePrice(10)
+ supply_line.setPricedQuantity(1)
+ supply_line.setDefaultResourceValue(product)
+ supply_line.setPriceCurrency('currency_module/1')
def test_01_AddResourceToShoppingCart(self, quiet=0, run=run_all_test):
"""
@@ -561,7 +622,31 @@
self.assertEquals(currency, portal.SaleOrder_getShoppingCartDefaultCurrency())
-
+ def test_18_webSiteInitialisation(self, quiet=0, run=run_all_test):
+ """
+ Test the SaleOrder_getShoppingCartDefaultCurrency script
+ """
+ if not run:
+ return
+ if not quiet:
+ message = '\nTest to get the default currency of a shopping cart'
+ ZopeTestCase._print(message)
+ LOG('Testing... ', 0, message)
+
+ portal = self.getPortal()
+
+ def test_19_simulatePaypalPayment(self, quiet=0, run=run_all_test):
+ """
+ Test all the scripts related to paypal
+ """
+ if not run:
+ return
+ if not quiet:
+ message = '\nTest to simulate paypal payment.'
+ ZopeTestCase._print(message)
+ LOG('Testing... ', 0, message)
+
+ portal = self.getPortal()
import unittest
def test_suite():
More information about the Erp5-report
mailing list