From 11df2f11842cc4bf2fc198d6e6eb394abd33422a Mon Sep 17 00:00:00 2001 From: Unrud Date: Fri, 2 Sep 2016 14:42:22 +0200 Subject: [PATCH] Test authentication Test for 2a9f37defb145383f0c572cbe45ea3b2201a343f --- radicale/tests/test_base.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index f7d2e81..ee47169 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -766,6 +766,14 @@ class BaseRequestsMixIn: assert status == 207 assert "href>/user/<" in answer + def test_authentication(self): + """Test if server sends authentication request.""" + self.configuration.set("rights", "type", "owner_only") + self.application = Application(self.configuration, self.logger) + status, headers, answer = self.request("MKCOL", "/user/") + assert status in (401, 403) + assert headers.get("WWW-Authenticate") + def test_principal_collection_creation(self): """Verify existence of the principal collection.""" status, headers, answer = self.request(