diff --git a/website_require_login/__manifest__.py b/website_require_login/__manifest__.py index 7dc343fb3e..0bb2fe40fe 100644 --- a/website_require_login/__manifest__.py +++ b/website_require_login/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Website Login Required", "category": "Website", - "version": "14.0.1.0.0", + "version": "15.0.1.0.0", "author": "Advitus MB, Ooops, Odoo Community Association (OCA)", "website": "https://github.com/OCA/website", "license": "LGPL-3", diff --git a/website_require_login/readme/CONTRIBUTORS.rst b/website_require_login/readme/CONTRIBUTORS.rst index b5f195b844..f07b76cdb6 100644 --- a/website_require_login/readme/CONTRIBUTORS.rst +++ b/website_require_login/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Ooops404 +* Nils Coenen diff --git a/website_require_login/tests/test_ir_http.py b/website_require_login/tests/test_ir_http.py index 23d31cf2ed..08046849c9 100644 --- a/website_require_login/tests/test_ir_http.py +++ b/website_require_login/tests/test_ir_http.py @@ -2,26 +2,27 @@ class TestIrHttp(HttpCase): - def setUp(self): - super().setUp() - self.website = self.env["website"].sudo().get_current_website() - self.auth_url = self.env["website.auth.url"].create( - {"website_id": self.website.id, "path": "/contactus"} + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.website = cls.env["website"].sudo().get_current_website() + cls.auth_url = cls.env["website.auth.url"].create( + {"website_id": cls.website.id, "path": "/contactus"} ) - self.user = self.env["res.users"].create( + cls.user = cls.env["res.users"].create( {"name": "Test User", "login": "test_user", "password": "12345"} ) - self.path = "/contactus" - self.expected_path = "/web/login?redirect=%s" % self.path + cls.path = "/contactus" + cls.expected_path = "/web/login?redirect=%s" % cls.path def test_dispatch_unauthorized(self): - # Test that an unauthorized user cannot access "/auth_path + # Test that a public user cannot access "/auth_path self.authenticate(None, None) response = self.url_open(self.path, allow_redirects=False) self.assertEqual( response.status_code, - 302, - "Expected the response status code to be 302 indicating a redirect", + 303, + "Expected the response status code to be 303 indicating a redirect", ) self.assertIn(self.expected_path, response.headers["Location"]) diff --git a/website_require_login/views/website_auth_url.xml b/website_require_login/views/website_auth_url.xml index c60e9e218b..2e354a1621 100644 --- a/website_require_login/views/website_auth_url.xml +++ b/website_require_login/views/website_auth_url.xml @@ -5,7 +5,7 @@ website.auth.url website.auth.url - +