Skip to content

Commit

Permalink
Merge pull request #541 from claudep/test_master
Browse files Browse the repository at this point in the history
Made tests pass with master again
  • Loading branch information
craigds committed Feb 13, 2017
2 parents 6ecaf70 + 49528f3 commit aca6a74
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sudo: false
language: python

python:
- "3.6-dev"
- "3.6"
- "3.5"
- "3.4"
- "3.3"
Expand Down
5 changes: 4 additions & 1 deletion mptt/templatetags/mptt_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
from django.urls import NoReverseMatch
except ImportError: # Django < 1.10 pragma: no cover
from django.core.urlresolvers import NoReverseMatch
from django.utils.deprecation import RemovedInDjango20Warning
try:
from django.utils.deprecation import RemovedInDjango20Warning
except ImportError:
RemovedInDjango20Warning = RuntimeWarning
from django.utils.encoding import force_text
from django.utils.html import format_html
from django.utils.safestring import mark_safe
Expand Down
8 changes: 6 additions & 2 deletions tests/myapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ class MPTTMeta:


class UUIDNode(MPTTModel):
parent = models.ForeignKey('self', null=True, blank=True, related_name='children')
parent = models.ForeignKey(
'self', null=True, blank=True, related_name='children',
on_delete=models.CASCADE)
uuid = models.UUIDField(primary_key=True, default=uuid4)
name = models.CharField(max_length=50)

Expand Down Expand Up @@ -325,5 +327,7 @@ class Book(MPTTModel):
on_delete=models.CASCADE)

name = models.CharField(max_length=50)
fk = TreeForeignKey(Category, null=True, blank=True, related_name='books_fk')
fk = TreeForeignKey(
Category, null=True, blank=True, related_name='books_fk',
on_delete=models.CASCADE)
m2m = TreeManyToManyField(Category, blank=True, related_name='books_m2m')
11 changes: 5 additions & 6 deletions tests/myapp/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import django
from django.conf.urls import include, url

from django.contrib import admin


admin.autodiscover()


urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
]
if django.VERSION >= (1, 9):
urlpatterns = [url(r'^admin/', admin.site.urls)]
else:
urlpatterns = [url(r'^admin/', include(admin.site.urls))]
9 changes: 6 additions & 3 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@

STATIC_URL = '/static/'
SECRET_KEY = 'abc123'
MIDDLEWARE_CLASSES = (
MIDDLEWARE = [
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
)
]
# Compatibility for Django < 1.10
MIDDLEWARE_CLASSES = MIDDLEWARE + [
'django.contrib.auth.middleware.SessionAuthenticationMiddleware'
]

TEMPLATES = [
{
Expand Down

0 comments on commit aca6a74

Please sign in to comment.