<commit_before>from odoo.tests import common


class TestDomainUpdating(common.HttpCase):
    at_install = False
    post_install = True

    def test_authenticate(self):
        db_name = common.get_db_name()
        env = dict(
            base_location="http://build-123.runbot.example.com",
        )
        uid = self.registry['res.users'].authenticate(db_name, 'admin', 'admin', env)
        # since Odoo 12.0 admin user is 2
        self.assertEqual(uid, 2)<commit_msg>:shield: website_multi_company_demo website domains<commit_after>import re
from odoo.tests import common
from ..models.res_users import WEBSITE_REFS, WEBSITE_RE


class TestDomainUpdating(common.HttpCase):
    at_install = False
    post_install = True

    def test_authenticate(self):
        db_name = common.get_db_name()
        env = dict(
            base_location="http://build-123.runbot.example.com",
        )
        website_domains = {}
        for wref in WEBSITE_REFS:
            website = self.env.ref(wref, raise_if_not_found=False)
            m = re.search(WEBSITE_RE, website.domain)
            self.assertTrue(bool(m))
            key = m.group(1)
            website_domains[wref] = 'build-123.' + key + '.runbot.example.com'
        uid = self.registry['res.users'].authenticate(db_name, 'admin', 'admin', env)
        # since Odoo 12.0 admin user is 2
        self.assertEqual(uid, 2)

        for wref in WEBSITE_REFS:
            website = self.env.ref(wref, raise_if_not_found=False)
            self.assertEqual(
                website.domain,
                website_domains[wref]
            )
{'fraction_non_alphanumeric': 0.10542732376793512, 'fraction_numerical': 0.012476606363069246, 'mean_word_length': 2.3983050847457625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7246600', 'n_tokens_mistral': 523, 'n_tokens_neox': 493, 'n_words': 99}