Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(34)  |  Call(34)  |  Derive(0)  |  Import(0)
Fail if the two objects are unequal as determined by the '=='
operator.

src/o/p/openerp-core-7.0.406/openerp/tests/test_orm.py   openerp-core(Download)
        # exceptions even when simply opening a list view!
        # /!\ Using unprileged user to detect former side effects of ir.rules!
        self.assertEqual([{'id': p2, 'name': 'Y'}], self.partner.read(cr, uid2, [p1,p2], ['name']), "read() should skip deleted records")
        self.assertEqual([], self.partner.read(cr, uid2, [p1], ['name']), "read() should skip deleted records")
 
        partners_after = self.partner.search(self.cr, UID, [])
 
        self.assertEqual(set(partners_before), set(partners_after))
 
        foo = self.user.browse(self.cr, UID, foo_id)
        self.assertEqual(foo.name, 'Foo')
        self.assertEqual(foo.partner_id.id, par_id)

src/o/p/openerp-core-7.0.406/openerp/tests/test_basecase.py   openerp-core(Download)
    def test_00(self):
        """Create a partner."""
        cr, uid = self.cr, self.uid
        ids = self.registry('res.partner').search(cr, uid, [('name', '=', 'test_per_class_teardown_partner')])
        self.assertEqual(0, len(ids), "Test partner found.")
        self.registry('res.partner').create(cr, uid, {'name': 'test_per_class_teardown_partner'})
        ids = self.registry('res.partner').search(cr, uid, [('name', '=', 'test_per_class_teardown_partner')])
        self.assertEqual(1, len(ids), "Test partner not found.")
    def test_01(self):
        """Don't find the created partner."""
        cr, uid = self.cr, self.uid
        ids = self.registry('res.partner').search(cr, uid, [('name', '=', 'test_per_class_teardown_partner')])
        self.assertEqual(0, len(ids), "Test partner found.")
        partner = res_partner.browse(cr, uid, pid)
        p_browse_ref = self.browse_ref(xid)
        self.assertEqual(partner, p_browse_ref, "browse_ref() should resolve xid to browse records")
 
if __name__ == '__main__':

src/o/p/openerp-core-7.0.406/openerp/tests/test_acl.py   openerp-core(Download)
                    part.email
 
            self.assertEqual(cm.exception.args[0], 'Access Denied')
        finally:
            self.res_partner._columns['email'].groups = False

src/o/p/openerp-core-7.0.406/openerp/tests/test_fields.py   openerp-core(Download)
        partner_ids1 = self.partner.search(self.cr, self.uid, [('company_id', 'in', company_ids)])
        partner_ids2 = self.partner.search(self.cr, self.uid, [('related_company_partner_id', '=', id)])
        self.assertEqual(partner_ids1, partner_ids2)
 
        # restore res.partner fields
 
        # check reading related field
        self.assertEqual(partner[field], partner.company_id)
 
        # check that search on related field is equivalent to original field
        ids1 = self.partner.search(self.cr, self.uid, [('company_id', '=', partner.company_id.id)])
        ids2 = self.partner.search(self.cr, self.uid, [(field, '=', partner.company_id.id)])
        self.assertEqual(ids1, ids2)
 
        company = self.company.browse(self.cr, self.uid, company_ids[0])
        self.assertEqual(company.partner_id.id, new_partner_id)
 
        partner = self.partner.browse(self.cr, self.uid, partner_ids[0])
        self.assertEqual(partner.related_company_partner_id.id, new_partner_id)