Skip to content

Commit b751b08

Browse files
committed
removed django1.4 specific code
1 parent 98b078d commit b751b08

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

oauth2_provider/models.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,8 @@ def __str__(self):
126126

127127

128128
class Application(AbstractApplication):
129-
pass
130-
131-
# Add swappable like this to not break django 1.4 compatibility
132-
Application._meta.swappable = 'OAUTH2_PROVIDER_APPLICATION_MODEL'
129+
class Meta(AbstractApplication.Meta):
130+
swappable = 'OAUTH2_PROVIDER_APPLICATION_MODEL'
133131

134132

135133
@python_2_unicode_compatible

oauth2_provider/tests/test_mixins.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from django.core.exceptions import ImproperlyConfigured
44
from django.views.generic import View
55
from django.test import TestCase, RequestFactory
6-
from django.http import HttpResponse
76

87
from oauthlib.oauth2 import Server
98

@@ -100,10 +99,6 @@ class TestView(ProtectedResourceMixin, View):
10099
server_class = Server
101100
validator_class = OAuth2Validator
102101

103-
def options(self, request, *args, **kwargs):
104-
"""Django 1.4 doesn't provide a default options method"""
105-
return HttpResponse()
106-
107102
request = self.request_factory.options("/fake-req")
108103
view = TestView.as_view()
109104
response = view(request)

oauth2_provider/tests/test_models.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from __future__ import unicode_literals
22

3-
from unittest import skipIf
4-
53
import django
64
from django.contrib.auth import get_user_model
75
from django.core.exceptions import ValidationError
@@ -109,7 +107,6 @@ def test_scopes_property(self):
109107
self.assertEqual(access_token2.scopes, {'write': 'Writing scope'})
110108

111109

112-
@skipIf(django.VERSION < (1, 5), "Behavior is broken on 1.4 and there is no solution")
113110
@override_settings(OAUTH2_PROVIDER_APPLICATION_MODEL='tests.TestApplication')
114111
class TestCustomApplicationModel(TestCase):
115112
def setUp(self):

0 commit comments

Comments
 (0)