Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…oolkit into orcasgit-django18
  • Loading branch information
masci committed May 23, 2015
2 parents a4cb936 + 0514233 commit 3b2f248
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ env:
- TOX_ENV=py27-django15
- TOX_ENV=py27-django16
- TOX_ENV=py27-django17
- TOX_ENV=py27-django18
- TOX_ENV=py33-django15
- TOX_ENV=py33-django16
- TOX_ENV=py33-django17
- TOX_ENV=py33-django18
- TOX_ENV=py34-django15
- TOX_ENV=py34-django16
- TOX_ENV=py34-django17
- TOX_ENV=py34-django18
- TOX_ENV=docs

install:
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Requirements
------------

* Python 2.6, 2.7, 3.3, 3.4
* Django 1.4, 1.5, 1.6, 1.7
* Django 1.4, 1.5, 1.6, 1.7, 1.8

Installation
------------
Expand Down
1 change: 1 addition & 0 deletions oauth2_provider/tests/test_client_credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class TestExtendedRequest(BaseTest):
@classmethod
def setUpClass(cls):
cls.request_factory = RequestFactory()
super(TestExtendedRequest, cls).setUpClass()

def test_extended_request(self):
class TestView(OAuthLibMixin, View):
Expand Down
1 change: 1 addition & 0 deletions oauth2_provider/tests/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestProtectedResourceDecorator(TestCase, TestCaseUtils):
@classmethod
def setUpClass(cls):
cls.request_factory = RequestFactory()
super(TestProtectedResourceDecorator, cls).setUpClass()

def setUp(self):
self.user = UserModel.objects.create_user("test_user", "test@user.com", "123456")
Expand Down
1 change: 1 addition & 0 deletions oauth2_provider/tests/test_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class BaseTest(TestCase):
@classmethod
def setUpClass(cls):
cls.request_factory = RequestFactory()
super(BaseTest, cls).setUpClass()


class TestOAuthLibMixin(BaseTest):
Expand Down
8 changes: 5 additions & 3 deletions oauth2_provider/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def setUp(self):

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


class TestGrantModel(TestCase):
Expand Down
24 changes: 21 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tox]
envlist =
py26-django14, py26-django15, py26-django16,
py27-django14, py27-django15, py27-django16, py27-django17,
py33-django15, py33-django16, py33-django17,
py34-django15, py34-django16, py34-django17,
py27-django14, py27-django15, py27-django16, py27-django17, py27-django18,
py33-django15, py33-django16, py33-django17, py33-django18,
py34-django15, py34-django16, py34-django17, py34-django18,
docs,
flake8

Expand Down Expand Up @@ -59,6 +59,12 @@ deps =
Django<1.8
{[testenv]deps}

[testenv:py27-django18]
basepython = python2.7
deps =
Django<1.9
{[testenv]deps}

[testenv:py33-django15]
basepython = python3.3
deps =
Expand All @@ -78,6 +84,12 @@ deps =
Django<1.8
{[testenv]deps}

[testenv:py33-django18]
basepython = python3.3
deps =
Django<1.9
{[testenv]deps}

[testenv:py34-django15]
basepython = python3.4
deps =
Expand All @@ -97,6 +109,12 @@ deps =
Django<1.8
{[testenv]deps}

[testenv:py34-django18]
basepython = python3.4
deps =
Django<1.9
{[testenv]deps}

[testenv:docs]
basepython=python
changedir=docs
Expand Down

0 comments on commit 3b2f248

Please sign in to comment.