test_auth_api_key.py
362 Bytes
from odoo.tests.common import TransactionCase
class TestAuthApiKey(TransactionCase):
def test_auth(self):
example_uid = 6
example_api_key = '5ed9ca599bdd1a97f5e05a8e011e440b528a372e'
uid = self.env['res.users.apikeys']._check_credentials(
scope='rpc', key=example_api_key)
self.assertEqual(uid, example_uid)