Skip to content

Commit

Permalink
Merge pull request areski#71 from lgp171188/develop
Browse files Browse the repository at this point in the history
Fix the exceptions in tests with Django 1.9
  • Loading branch information
areski committed Dec 10, 2015
2 parents d974936 + 7fd3c0c commit d9a73e9
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions tests/test_template_tags.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
import unittest


import django
from django.template import (
Context,
Template
)
from django.conf import settings
settings.configure()
django.setup()
from django.test.utils import override_settings
try:
# django < 1.7
from django.template import loader
add_to_builtins = loader.add_to_builtins
except AttributeError:
try:
# django >= 1.7
from django.template.base import add_to_builtins
except ImportError:
# django >= 1.9
def add_to_builtins(module):
from django.template.engine import Engine
template_engine = Engine.get_default()
template_engine.builtins.append(module)
template_engine.template_builtins = \
template_engine.get_template_builtins(template_engine.builtins)
from django.template.base import add_to_builtins
except ImportError:
# django >= 1.9
def add_to_builtins(module):
from django.template.engine import Engine
template_engine = Engine.get_default()
template_engine.builtins.append(module)
template_engine.template_builtins = \
template_engine.get_template_builtins(template_engine.builtins)

from django_nvd3.templatetags.nvd3_tags import load_chart, include_container

Expand Down

0 comments on commit d9a73e9

Please sign in to comment.