Skip to content

Commit

Permalink
Merge pull request #24 from quiqueporta/master
Browse files Browse the repository at this point in the history
Compatibility with Django 1.9
  • Loading branch information
BYK committed Apr 22, 2016
2 parents 2cc7daf + 129a954 commit e3f4adb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 15 deletions.
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,20 @@ python:
- "3.4"

env:
- DJANGO='Django==1.3.*'
- DJANGO='Django==1.4.*'
- DJANGO='Django==1.5.*'
- DJANGO='Django==1.6.*'
- DJANGO='Django==1.7.*'
- DJANGO='Django==1.8.*'
- DJANGO='Django==1.9.*'

matrix:
exclude:
- env: DJANGO='Django==1.7.*'
python: "2.6"
- env: DJANGO='Django==1.8.*'
python: "2.6"
- env: DJANGO='Django==1.3.*'
python: "3.4"
- env: DJANGO='Django==1.4.*'
python: "3.4"
- env: DJANGO='Django==1.9.*'
python: "2.6"

install:
- pip install $DJANGO
Expand Down
15 changes: 12 additions & 3 deletions mailviews/previews.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,17 @@
from django.core.urlresolvers import reverse
from django.http import Http404
from django.shortcuts import render
from django.utils.datastructures import SortedDict
from django.utils.importlib import import_module

try:
from collections import OrderedDict
except ImportError:
from django.utils.datastructures import SortedDict as OrderedDict

try:
from importlib import import_module
except ImportError:
from django.utils.importlib import import_module

from django.utils.module_loading import module_has_submodule

from mailviews.helpers import should_use_staticfiles
Expand Down Expand Up @@ -180,7 +189,7 @@ def detail_view(self, request):

message = message_view.render_to_message()
raw = message.message()
headers = SortedDict((header, maybe_decode_header(raw[header])) for header in self.headers)
headers = OrderedDict((header, maybe_decode_header(raw[header])) for header in self.headers)

context.update({
'message': message,
Expand Down
1 change: 0 additions & 1 deletion mailviews/templates/mailviews/base.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{% load url from future %}
<!doctype html>
<html lang="en">
<head>
Expand Down
2 changes: 2 additions & 0 deletions mailviews/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
settings.configure(
DEBUG=True,
INSTALLED_APPS=(
'django.contrib.auth',
'django.contrib.contenttypes',
'mailviews',
'mailviews.tests',
),
Expand Down
9 changes: 4 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
envlist:
py26-django1.{3,4,5,6},
py27-django1.{3,4,5,6,7,8},
py34-django1.{5,6,7,8}
py26-django1.{5,6},
py27-django1.{5,6,7,8,9},
py34-django1.{5,6,7,8,9}

[testenv]
commands = python setup.py test
Expand All @@ -11,9 +11,8 @@ basepython =
py27: python2.7
py34: python3.4
deps =
django1.3: Django==1.3.*
django1.4: Django==1.4.*
django1.5: Django==1.5.*
django1.6: Django==1.6.*
django1.7: Django==1.7.*
django1.8: Django==1.8.*
django1.9: Django==1.9.*

0 comments on commit e3f4adb

Please sign in to comment.