Skip to content

Commit

Permalink
fixed tests for Django 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
masci committed Mar 26, 2015
1 parent 6728a4a commit cc9cb4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions oauth2_provider/tests/test_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.core.exceptions import ImproperlyConfigured
from django.views.generic import View
from django.test import TestCase, RequestFactory
from django.http import HttpResponse

from oauthlib.oauth2 import Server

Expand Down Expand Up @@ -85,6 +86,10 @@ class TestView(ProtectedResourceMixin, View):
server_class = Server
validator_class = OAuth2Validator

def options(self, request, *args, **kwargs):
"""Django 1.4 doesn't provide a default options method"""
return HttpResponse()

request = self.request_factory.options("/fake-req")
view = TestView.as_view()
response = view(request)
Expand Down

0 comments on commit cc9cb4d

Please sign in to comment.