'test reference fields.'

def test_24_reference(self):

    record = self.env['test_new_api.mixed'].create({})
    record.reference = None
    self.assertFalse(record.reference)
    record.reference = self.env.user
    self.assertEqual(record.reference, self.env.user)
    record.reference = self.env.user.partner_id
    self.assertEqual(record.reference, self.env.user.partner_id)
    with self.assertRaises(ValueError):
        record.reference = self.env['ir.model'].search([], limit=1)
