[Erp5-report] r29040 - /erp5/trunk/products/ERP5/tests/testERP5Commerce.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Sep 14 22:18:09 CEST 2009


Author: lucas
Date: Mon Sep 14 22:18:08 2009
New Revision: 29040

URL: http://svn.erp5.org?rev=29040&view=rev
Log:
Removed useless import. Updated TODO list. Replaced the test of SalerOrder_confirmShopping for SaleOrder_paymentRedirect.

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=29040&r1=29039&r2=29040&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5Commerce.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testERP5Commerce.py [utf8] Mon Sep 14 22:18:08 2009
@@ -26,12 +26,9 @@
 #
 ##############################################################################
 
-import os, sys
-
 from Testing import ZopeTestCase
 from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
 from AccessControl.SecurityManagement import newSecurityManager
-from AccessControl.SecurityManagement import getSecurityManager
 from zLOG import LOG
 import transaction
 import urllib
@@ -67,7 +64,6 @@
   > Test SaleOrder_getShoppingCartItemList With include_shipping=True
   > implement Person_getApplicableDiscountList (actually just return None)
   > implement Person_getApplicableTaxList (actually always return a tax of 20%)
-  > Fix proxy for SaleOrder_confirmShopping, and anonym user cant call it !
   > SaleOrder_externalPaymentHandler is totally empty
   > SaleOrder_finalizeShopping doesnt check if the payment is successful or not
   > Fix proxy for SaleOrder_finalizeShopping anonym and normal user cant use it
@@ -84,7 +80,6 @@
   SaleOrder_externalPaymentHandler
   SaleOrder_getSelectedShippingResource
   SaleOrder_isShippingRequired
-  SaleOrder_paymentRedirect
   WebSection_checkPaypalIdentification
   WebSection_checkoutProcedure
   WebSection_doPaypalPayment
@@ -194,11 +189,6 @@
 
     #XXX: Security hack (lucas)
     self.portal.acl_users.zodb_roles.assignRoleToPrincipal('Manager', reference)
-
-  def changeUser(self, name):
-    user_folder = self.getPortal().acl_users
-    user = user_folder.getUserById(name).__of__(user_folder)
-    newSecurityManager(None, user)
 
   def login(self):
     uf = self.getPortal().acl_users
@@ -587,14 +577,14 @@
     # XXX : actually the script is only in squeleton mode, only return a tax of 20%
     self.assertEquals({'VAT':20.0}, self.getPortal().Person_getApplicableTaxList())
 
-  def test_10_confirmShopping(self, quiet=0, run=run_all_test):
-    """
-      Test the SaleOrder_confirmShopping script
-    """
-    if not run:
-      return
-    if not quiet:
-      message = '\nTest the confirmation of shopping'
+  def test_10_paymentRedirect(self, quiet=0, run=run_all_test):
+    """
+      Test the SaleOrder_paymentRedirect script
+    """
+    if not run:
+      return
+    if not quiet:
+      message = '\nTest the confirmation of shopping and payment redirect'
       ZopeTestCase._print(message)
       LOG('Testing... ', 0, message)
     portal = self.getPortal()
@@ -609,14 +599,14 @@
     # the confirmation should not be possible if the user is not logged
     self.logout()
     self.assertEquals(1, len(portal.SaleOrder_getShoppingCartItemList()))
-    self.portal.SaleOrder_confirmShopping()
+    self.portal.SaleOrder_paymentRedirect()
     self.assertTrue(urllib.quote("You need to create an account to " \
-                                 "continue If you already have please login.") in 
+                                 "continue. If you already have please login.") in 
                     request.RESPONSE.getHeader('location'))
 
     # but it should work if the user is authenticated
     self.changeUser('customer')
-    self.portal.SaleOrder_confirmShopping()
+    self.portal.SaleOrder_paymentRedirect()
     self.assertTrue(urllib.quote("SaleOrder_viewConfirmAsWeb") in
                     request.RESPONSE.getHeader('location'))
 




More information about the Erp5-report mailing list