[REF] osv: osv_memory is really just osv,
the change is not enough as we still want to differentiate between regular osv and osv that should be wiped from the db from time to time. bzr revid: vmt@openerp.com-20110728082752-39jur9oo0m93ebzh
This commit is contained in:
parent
8504e6158b
commit
44d41334d7
|
@ -144,45 +144,3 @@
|
|||
!python {model: res.partner.category}: |
|
||||
self.pool._init = True
|
||||
|
||||
-
|
||||
"OSV Memory: Verify that osv_memory properly handles large data allocation"
|
||||
-
|
||||
1. No "count-based" auto-vaccuum when max_count is disabled
|
||||
-
|
||||
!python {model: base.language.export}: |
|
||||
# setup special limits for the test, these will be reset at next pool reload anyway
|
||||
self._max_count = None
|
||||
num_recs = 250
|
||||
for i in xrange(num_recs):
|
||||
self.create(cr, uid, {'format':'po'})
|
||||
assert (len(self.datas) >= num_recs), "OSV Memory must not auto-vaccum records from the current transaction if max_count is not set"
|
||||
-
|
||||
2. Auto-vaccuum should be enabled when max_count is set
|
||||
-
|
||||
!python {model: base.language.export}: |
|
||||
# setup special limits for the test, these will be reset at next pool reload anyway
|
||||
self._max_count = 100
|
||||
num_recs = 219
|
||||
for i in xrange(num_recs):
|
||||
self.create(cr, uid, {'name': i, 'format':'po'})
|
||||
assert (self._max_count <= len(self.datas) < self._max_count + self._check_time), "OSV Memory must auto-expire records when max_count is reached"
|
||||
for k,v in self.datas.iteritems():
|
||||
assert (int(v['name']) >= (num_recs - (self._max_count + self._check_time))), "OSV Memory must auto-expire records based on age"
|
||||
-
|
||||
3. Auto-vaccuum should be based on age only when max_count is not set
|
||||
-
|
||||
!python {model: base.language.export}: |
|
||||
# setup special limits for the test, these will be reset at next pool reload anyway
|
||||
self._max_count = None
|
||||
self._max_hours = 0.01 #36 seconds
|
||||
num_recs = 200
|
||||
for i in xrange(num_recs):
|
||||
self.create(cr, uid, {'format':'po'})
|
||||
assert (len(self.datas) >= num_recs), "OSV Memory must not auto-expire records from the current transaction"
|
||||
|
||||
# expire all records
|
||||
for k,v in self.datas.iteritems():
|
||||
v['internal.date_access'] = 0
|
||||
self.vaccum(cr, 1, force=True)
|
||||
|
||||
assert (len(self.datas) == 0), "OSV Memory must expire old records after vaccuum"
|
||||
|
|
|
@ -3380,7 +3380,7 @@ class orm(orm_template):
|
|||
# return _proxy
|
||||
|
||||
|
||||
def fields_get(self, cr, user, fields=None, context=None):
|
||||
def fields_get(self, cr, user, fields=None, context=None, write_access=True):
|
||||
"""
|
||||
Get the description of list of fields
|
||||
|
||||
|
|
|
@ -199,7 +199,7 @@ class object_proxy(netsvc.Service):
|
|||
return res
|
||||
|
||||
|
||||
class osv_memory(orm.orm_memory):
|
||||
class osv_memory(orm.orm):
|
||||
""" Deprecated class. """
|
||||
__metaclass__ = MetaModel
|
||||
_register = False # Set to false if the model shouldn't be automatically discovered.
|
||||
|
|
Loading…
Reference in New Issue