'Create a partner with a XML ID then resolve xml id with ref() and browse_ref()'

def test_20a(self):

    (pid, _) = self.env['res.partner'].name_create('Mr    Yellow')
    self.env['ir.model.data'].create({'name': 'test_partner_yellow', 'module': 'base', 'model': 'res.partner', 'res_id': pid})
    xid = 'base.test_partner_yellow'
    partner = self.env.ref(xid)
    pid = self.ref(xid)
    self.assertEquals(pid, partner.id, 'ref()    should    resolve    xid    to    database    ID')
    partner2 = self.browse_ref(xid)
    self.assertEqual(partner, partner2, 'browse_ref()    should    resolve    xid    to    browse    records')
