This commit is contained in:
2026-11-08 20:08:53 +08:00
parent 7526a5fe4d
commit 9b924747c5
2692 changed files with 394867 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import tagged
from odoo.tests.common import TransactionCase
@tagged("post_install", "-at_install")
class TestAIWebPage(TransactionCase):
def _create_web_page(self, url):
return self.env["ai.web.page"].create({"url": url})
def test_robots_txt_uses_main_domain_for_internal_urls(self):
self.env["website"].create({
"name": "Internal Website",
"domain": "https://shop.example.com",
})
web_page = self._create_web_page("https://blog.example.com/article")
self.assertIn("example.com", web_page._get_internal_domains())
self.assertFalse(web_page._should_check_robots_txt())