<commit_before># Copyright 2017 LasLabs Inc.
# License APL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo.tests.common import HttpCase
from odoo.tools import mute_logger


class TestController(HttpCase):
    def _test_page(self, page, code=200):
        response = self.url_open(page, timeout=20)
        self.assertEqual(response.status_code, code)

    # TODO: comment this test because odoo 11 return 200 even if page does not exist..
    # @mute_logger("odoo.addons.website.models.ir_ui_view")
    # def test_unknown(self):
    #     """ It should return a 404 for unknown pages. """
    #     self._test_page('/legal/no-page', 404)

    def test_privacy(self):
        """ It should return a 200 for privacy policy page. """
        self._test_page('/legal/privacy-policy')

    def test_advice(self):
        """ It should return a 200 for advice page. """
        self._test_page('/legal/advice')

    def test_tos(self):
        """ It should return a 200 for ToS page. """
        self._test_page('/legal/terms-of-use')<commit_msg>[WARN] failure expected on test due to odoo framework bug<commit_after># Copyright 2017 LasLabs Inc.
# License APL-3.0 or later (http://www.gnu.org/licenses/agpl).

import unittest
from odoo.tests.common import HttpCase
from odoo.tools import mute_logger


class TestController(HttpCase):
    def _test_page(self, page, code=200):
        response = self.url_open(page, timeout=20)
        self.assertEqual(response.status_code, code)

    # HACK https://github.com/odoo/odoo/issues/22438
    # TODO Remove when fixed
    @unittest.expectedFailure
    @mute_logger("odoo.addons.website.models.ir_ui_view")
    def test_unknown(self):
        """ It should return a 404 for unknown pages. """
        self._test_page('/legal/no-page', 404)

    def test_privacy(self):
        """ It should return a 200 for privacy policy page. """
        self._test_page('/legal/privacy-policy')

    def test_advice(self):
        """ It should return a 200 for advice page. """
        self._test_page('/legal/advice')

    def test_tos(self):
        """ It should return a 200 for ToS page. """
        self._test_page('/legal/terms-of-use')
{'fraction_non_alphanumeric': 0.12276683463124141, 'fraction_numerical': 0.028401282638570773, 'mean_word_length': 3.051948051948052, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, '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': '923347', 'n_tokens_mistral': 742, 'n_tokens_neox': 674, 'n_words': 184}