Skip to content

Commit

Permalink
Fixed #290 -- RemovedInDjango20Warning: Importing from django.core.ur…
Browse files Browse the repository at this point in the history
…lresolvers is deprecated in favor of django.urls
  • Loading branch information
felixxm committed Oct 29, 2016
1 parent aaa4516 commit c2484f0
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 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,6 +1,10 @@
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
7 changes: 5 additions & 2 deletions pinax/stripe/tests/test_middleware.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from django.core.urlresolvers import reverse
from django.contrib.auth import authenticate, login, logout, get_user_model
from django.test import TestCase
from django.utils import timezone

from django.contrib.auth import authenticate, login, logout, get_user_model
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse

from mock import Mock

Expand Down
7 changes: 5 additions & 2 deletions pinax/stripe/tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from django.core.urlresolvers import reverse
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.utils import timezone

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

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 c2484f0

Please sign in to comment.