From 835cf557f93969770b1138bd50fe74bae17f0f86 Mon Sep 17 00:00:00 2001 From: Lihan Li Date: Tue, 27 Feb 2018 16:01:17 +1100 Subject: [PATCH 1/2] Remove the setting that cause tests to fail, there is no URLs inside "tests" --- test_settings.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test_settings.py b/test_settings.py index deb178e..be0cdbd 100644 --- a/test_settings.py +++ b/test_settings.py @@ -12,6 +12,5 @@ 'rest_framework_httpsignature', ) -ROOT_URLCONF = 'rest_framework_httpsignature.tests' SECRET_KEY = 'MY PRIVATE SECRET' From 40faf3587bc474f7b0858f6ef0b8a44623fd0950 Mon Sep 17 00:00:00 2001 From: Lihan Li Date: Tue, 27 Feb 2018 16:01:40 +1100 Subject: [PATCH 2/2] Fixed regex that fail to capture the signature substring. --- rest_framework_httpsignature/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework_httpsignature/tests.py b/rest_framework_httpsignature/tests.py index e2eda6e..b77d73e 100644 --- a/rest_framework_httpsignature/tests.py +++ b/rest_framework_httpsignature/tests.py @@ -137,7 +137,7 @@ def test_build_signature(self): signature_string = self.auth.build_signature( self.KEYID, SECRET, req) signature = re.match( - '.*signature="(.+)",?.*', signature_string).group(1) + r'.*signature="(.+)",.*', signature_string).group(1) self.assertEqual(expected_signature, signature)