[Python-modules-commits] [django-oauth-toolkit] 08/11: Add patches to fix tests for latest Django.
Michael Fladischer
fladi at moszumanska.debian.org
Thu Nov 2 16:08:20 UTC 2017
This is an automated email from the git hooks/post-receive script.
fladi pushed a commit to branch debian/master
in repository django-oauth-toolkit.
commit f1cb5364ef0a18a79cd17e54b9b0cf2deeb0426c
Author: Michael Fladischer <FladischerMichael at fladi.at>
Date: Thu Nov 2 16:38:16 2017 +0100
Add patches to fix tests for latest Django.
---
debian/changelog | 1 +
...SETTINGS_MODULE-to-get-picked-up-by-pytes.patch | 20 +++++++++++++++
...-Request-response-instead-of-Unauthorized.patch | 30 ++++++++++++++++++++++
debian/patches/series | 2 ++
4 files changed, 53 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 7b2a5a8..e100759 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ django-oauth-toolkit (1.0.0-1) UNRELEASED; urgency=low
* Refresh patches after git-dpm to gbp pq conversion
* Add python(3)-requests to Build-Depends as they are used during
tests.
+ * Add patches to fix tests for latest Django.
-- Michael Fladischer <fladi at debian.org> Tue, 20 Jun 2017 09:48:07 +0200
diff --git a/debian/patches/0002-Add-DJANGO_SETTINGS_MODULE-to-get-picked-up-by-pytes.patch b/debian/patches/0002-Add-DJANGO_SETTINGS_MODULE-to-get-picked-up-by-pytes.patch
new file mode 100644
index 0000000..72c8159
--- /dev/null
+++ b/debian/patches/0002-Add-DJANGO_SETTINGS_MODULE-to-get-picked-up-by-pytes.patch
@@ -0,0 +1,20 @@
+From: Michael Fladischer <FladischerMichael at fladi.at>
+Date: Thu, 2 Nov 2017 16:34:46 +0100
+Subject: Add DJANGO_SETTINGS_MODULE to get picked up by pytest-django.
+
+---
+ tox.ini | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tox.ini b/tox.ini
+index 329e2ce..992b994 100644
+--- a/tox.ini
++++ b/tox.ini
+@@ -45,6 +45,7 @@ omit = */migrations/*
+
+ [pytest]
+ django_find_project = false
++DJANGO_SETTINGS_MODULE = tests.settings
+
+ [flake8]
+ max-line-length = 110
diff --git a/debian/patches/0003-Expect-Bad-Request-response-instead-of-Unauthorized.patch b/debian/patches/0003-Expect-Bad-Request-response-instead-of-Unauthorized.patch
new file mode 100644
index 0000000..760445d
--- /dev/null
+++ b/debian/patches/0003-Expect-Bad-Request-response-instead-of-Unauthorized.patch
@@ -0,0 +1,30 @@
+From: Michael Fladischer <FladischerMichael at fladi.at>
+Date: Thu, 2 Nov 2017 16:36:50 +0100
+Subject: Expect Bad Request response instead of Unauthorized.
+
+---
+ tests/test_authorization_code.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test_authorization_code.py b/tests/test_authorization_code.py
+index 6ca53e7..98672a1 100644
+--- a/tests/test_authorization_code.py
++++ b/tests/test_authorization_code.py
+@@ -883,7 +883,7 @@ class TestAuthorizationCodeTokenView(BaseTest):
+ }
+
+ response = self.client.post(reverse("oauth2_provider:token"), data=token_request_data)
+- self.assertEqual(response.status_code, 401)
++ self.assertEqual(response.status_code, 400)
+
+ def test_code_exchange_succeed_when_redirect_uri_match(self):
+ """
+@@ -948,7 +948,7 @@ class TestAuthorizationCodeTokenView(BaseTest):
+ auth_headers = get_basic_auth_header(self.application.client_id, self.application.client_secret)
+
+ response = self.client.post(reverse("oauth2_provider:token"), data=token_request_data, **auth_headers)
+- self.assertEqual(response.status_code, 401)
++ self.assertEqual(response.status_code, 400)
+
+ def test_code_exchange_succeed_when_redirect_uri_match_with_multiple_query_params(self):
+ """
diff --git a/debian/patches/series b/debian/patches/series
index 3c50a87..583f946 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
0001-Replace-CDN-URL-with-a-local-bootstrap-CSS-file.patch
+0002-Add-DJANGO_SETTINGS_MODULE-to-get-picked-up-by-pytes.patch
+0003-Expect-Bad-Request-response-instead-of-Unauthorized.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/django-oauth-toolkit.git
More information about the Python-modules-commits
mailing list