Skip to content

Commit

Permalink
Merge pull request #291 from felixxm/issue-290
Browse files Browse the repository at this point in the history
Fixed #290 -- Importing from django.core.urlresolvers is deprecated in favor of django.urls
  • Loading branch information
paltman authored Dec 21, 2016
2 parents b5205bf + 5eec34f commit 08859b2
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Here is an example of these rules applied:

# second set of imports are Django imports with contrib in their own
# group.
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
Expand Down
6 changes: 5 additions & 1 deletion pinax/stripe/middleware.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import django
from django.core.urlresolvers import resolve
from django.shortcuts import redirect

try:
from django.urls import resolve
except ImportError:
from django.core.urlresolvers import resolve

from .actions import customers, subscriptions
from .conf import settings

Expand Down
6 changes: 5 additions & 1 deletion pinax/stripe/tests/test_admin.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import datetime

from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import Client, TestCase
from django.utils import timezone

try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse

from ..models import Customer, Invoice, Plan, Subscription


Expand Down
6 changes: 5 additions & 1 deletion pinax/stripe/tests/test_middleware.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils import timezone

try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse

from django.contrib.auth import authenticate, login, logout, get_user_model

from mock import Mock
Expand Down
6 changes: 5 additions & 1 deletion pinax/stripe/tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.utils import timezone

try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse

from django.contrib.auth import get_user_model

import stripe
Expand Down
6 changes: 5 additions & 1 deletion pinax/stripe/tests/test_webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@

import six

from django.core.urlresolvers import reverse
from django.dispatch import Signal
from django.test import TestCase
from django.test.client import Client

try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse

import stripe

from mock import patch
Expand Down

0 comments on commit 08859b2

Please sign in to comment.