Skip to content

Commit 3b2f248

Browse files
committed
Merge branch 'django18' of https://github.com/orcasgit/django-oauth-toolkit into orcasgit-django18
2 parents a4cb936 + 0514233 commit 3b2f248

File tree

7 files changed

+33
-7
lines changed

7 files changed

+33
-7
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ env:
99
- TOX_ENV=py27-django15
1010
- TOX_ENV=py27-django16
1111
- TOX_ENV=py27-django17
12+
- TOX_ENV=py27-django18
1213
- TOX_ENV=py33-django15
1314
- TOX_ENV=py33-django16
1415
- TOX_ENV=py33-django17
16+
- TOX_ENV=py33-django18
1517
- TOX_ENV=py34-django15
1618
- TOX_ENV=py34-django16
1719
- TOX_ENV=py34-django17
20+
- TOX_ENV=py34-django18
1821
- TOX_ENV=docs
1922

2023
install:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Requirements
4141
------------
4242

4343
* Python 2.6, 2.7, 3.3, 3.4
44-
* Django 1.4, 1.5, 1.6, 1.7
44+
* Django 1.4, 1.5, 1.6, 1.7, 1.8
4545

4646
Installation
4747
------------

oauth2_provider/tests/test_client_credential.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ class TestExtendedRequest(BaseTest):
110110
@classmethod
111111
def setUpClass(cls):
112112
cls.request_factory = RequestFactory()
113+
super(TestExtendedRequest, cls).setUpClass()
113114

114115
def test_extended_request(self):
115116
class TestView(OAuthLibMixin, View):

oauth2_provider/tests/test_decorators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class TestProtectedResourceDecorator(TestCase, TestCaseUtils):
1919
@classmethod
2020
def setUpClass(cls):
2121
cls.request_factory = RequestFactory()
22+
super(TestProtectedResourceDecorator, cls).setUpClass()
2223

2324
def setUp(self):
2425
self.user = UserModel.objects.create_user("test_user", "[email protected]", "123456")

oauth2_provider/tests/test_mixins.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class BaseTest(TestCase):
1616
@classmethod
1717
def setUpClass(cls):
1818
cls.request_factory = RequestFactory()
19+
super(BaseTest, cls).setUpClass()
1920

2021

2122
class TestOAuthLibMixin(BaseTest):

oauth2_provider/tests/test_models.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def setUp(self):
2525

2626
def test_allow_scopes(self):
2727
self.client.login(username="test_user", password="123456")
28-
app = Application(
28+
app = Application.objects.create(
2929
name="test_app",
3030
redirect_uris="http://localhost http://example.com http://example.it",
3131
user=self.user,
@@ -96,10 +96,12 @@ def test_related_objects(self):
9696
See issue #90 (https://github.com/evonove/django-oauth-toolkit/issues/90)
9797
"""
9898
# Django internals caches the related objects.
99-
del UserModel._meta._related_objects_cache
99+
if django.VERSION < (1, 8):
100+
del UserModel._meta._related_objects_cache
100101
related_object_names = [ro.name for ro in UserModel._meta.get_all_related_objects()]
101102
self.assertNotIn('oauth2_provider:application', related_object_names)
102-
self.assertIn('tests:testapplication', related_object_names)
103+
self.assertIn('tests%stestapplication' % (':' if django.VERSION < (1, 8) else '_'),
104+
related_object_names)
103105

104106

105107
class TestGrantModel(TestCase):

tox.ini

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[tox]
22
envlist =
33
py26-django14, py26-django15, py26-django16,
4-
py27-django14, py27-django15, py27-django16, py27-django17,
5-
py33-django15, py33-django16, py33-django17,
6-
py34-django15, py34-django16, py34-django17,
4+
py27-django14, py27-django15, py27-django16, py27-django17, py27-django18,
5+
py33-django15, py33-django16, py33-django17, py33-django18,
6+
py34-django15, py34-django16, py34-django17, py34-django18,
77
docs,
88
flake8
99

@@ -59,6 +59,12 @@ deps =
5959
Django<1.8
6060
{[testenv]deps}
6161

62+
[testenv:py27-django18]
63+
basepython = python2.7
64+
deps =
65+
Django<1.9
66+
{[testenv]deps}
67+
6268
[testenv:py33-django15]
6369
basepython = python3.3
6470
deps =
@@ -78,6 +84,12 @@ deps =
7884
Django<1.8
7985
{[testenv]deps}
8086

87+
[testenv:py33-django18]
88+
basepython = python3.3
89+
deps =
90+
Django<1.9
91+
{[testenv]deps}
92+
8193
[testenv:py34-django15]
8294
basepython = python3.4
8395
deps =
@@ -97,6 +109,12 @@ deps =
97109
Django<1.8
98110
{[testenv]deps}
99111

112+
[testenv:py34-django18]
113+
basepython = python3.4
114+
deps =
115+
Django<1.9
116+
{[testenv]deps}
117+
100118
[testenv:docs]
101119
basepython=python
102120
changedir=docs

0 commit comments

Comments
 (0)