~camptocamp/openobject-server/trunk-fix_1314680-afe

« back to all changes in this revision

Viewing changes to openerp/tests/common.py

  • Committer: Raphael Collet
  • Date: 2014-04-08 12:51:22 UTC
  • mto: This revision was merged to the branch mainline in revision 5169.
  • Revision ID: rco@openerp.com-20140408125122-ki0zmin3m21k2itd
[IMP] registry: add method get_cursor() to simply retrieve a new cursor, and refactor code to use it

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
    """
90
90
 
91
91
    def cursor(self):
92
 
        return self.registry.db.cursor()
 
92
        return self.registry.get_cursor()
93
93
 
94
94
    def ref(self, xid):
95
95
        """ Returns database ID corresponding to a given identifier.
138
138
    @classmethod
139
139
    def setUpClass(cls):
140
140
        cls.registry = openerp.modules.registry.RegistryManager.get(DB)
141
 
        cls.cr = cls.registry.db.cursor()
 
141
        cls.cr = cls.registry.get_cursor()
142
142
        cls.uid = openerp.SUPERUSER_ID
143
143
 
144
144
    @classmethod