Commit 5662b857 authored by Nicolas Dumazet's avatar Nicolas Dumazet

revert r38745 now that Order portal type is available.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38788 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8c7fd30a
...@@ -169,8 +169,8 @@ class SessionTool(BaseTool): ...@@ -169,8 +169,8 @@ class SessionTool(BaseTool):
session_id = '1234567' session_id = '1234567'
session = context.portal_sessions[session_id] session = context.portal_sessions[session_id]
session['shopping_cart'] = newTempSaleOrder(context, '987654321') # will work only for local RAM sessions session['shopping_cart'] = newTempOrder(context, '987654321') # will work only for local RAM sessions
(you can also use 'session.edit(shopping_cart= newTempSaleOrder(context, '987654321'))' ) (you can also use 'session.edit(shopping_cart= newTempOrder(context, '987654321'))' )
(later in another script you can acquire shopping_cart): (later in another script you can acquire shopping_cart):
...@@ -183,7 +183,7 @@ class SessionTool(BaseTool): ...@@ -183,7 +183,7 @@ class SessionTool(BaseTool):
- it's not recommended to store in portal_sessions ZODB persistent objects because in order - it's not recommended to store in portal_sessions ZODB persistent objects because in order
to store them in Local RAM portal_sessions tool will remove aquisition wrapper. At "get" to store them in Local RAM portal_sessions tool will remove aquisition wrapper. At "get"
request they'll be returend wrapped. request they'll be returend wrapped.
- developer can store temporary RAM based objects like 'TempSaleOrder' but ONLY - developer can store temporary RAM based objects like 'TempOrder' but ONLY
when using Local RAM type of sessions. In a distributed environment one can use only when using Local RAM type of sessions. In a distributed environment one can use only
pickable types ue to the nature of memcached server. pickable types ue to the nature of memcached server.
""" """
......
...@@ -111,12 +111,12 @@ class TestSessionTool(ERP5TypeTestCase): ...@@ -111,12 +111,12 @@ class TestSessionTool(ERP5TypeTestCase):
def stepTestAcquisitionRamSessionStorage(self, sequence=None, \ def stepTestAcquisitionRamSessionStorage(self, sequence=None, \
sequence_list=None, **kw): sequence_list=None, **kw):
from Products.ERP5Type.Document import newTempSaleOrder from Products.ERP5Type.Document import newTempOrder
portal_sessions = self.getPortal().portal_sessions portal_sessions = self.getPortal().portal_sessions
session = portal_sessions.newContent( session = portal_sessions.newContent(
self.session_id, \ self.session_id, \
attr_1 = newTempSaleOrder(portal_sessions, '1'), \ attr_1 = newTempOrder(portal_sessions, '1'), \
attr_2 = newTempSaleOrder(portal_sessions, '2'),) attr_2 = newTempOrder(portal_sessions, '2'),)
## check temp (RAM based) attributes stored in session ## check temp (RAM based) attributes stored in session
for i in range (1, 3): for i in range (1, 3):
attr_name = 'attr_%s' %i attr_name = 'attr_%s' %i
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment