Permalink
Browse files

Fix tests template loading.

  • Loading branch information...
1 parent 7223716 commit a1976251545cbbcf344e1c73c0bd7d4c9c611b9d @zlorf zlorf committed Oct 19, 2012
Showing with 9 additions and 3 deletions.
  1. +1 −0 MANIFEST.in
  2. +8 −0 envelope/tests/views.py
  3. +0 −3 runtests.py
View
@@ -3,4 +3,5 @@ include LICENSE
include README.rst
include MANIFEST.in
recursive-include envelope/templates *
+recursive-include envelope/tests/templates *
recursive-include envelope/locale *
View
@@ -2,10 +2,13 @@
Unit tests for ``django-envelope`` views.
"""
+import os
+
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
+from django.test.utils import override_settings
from django.utils import unittest
from django.utils.translation import ugettext_lazy as _
@@ -17,6 +20,11 @@
from envelope import signals
+test_templates = (
+ os.path.join(os.path.dirname(__file__), 'templates'),
+ os.path.join(os.path.dirname(__file__), '../templates'),
+)
+@override_settings(TEMPLATE_DIRS=test_templates)
class ContactViewTestCase(TestCase):
u"""
Unit tests for contact form view.
View
@@ -33,9 +33,6 @@ def make_absolute_path(path):
},
INSTALLED_APPS = INSTALLED_APPS,
SITE_ID = 1,
- TEMPLATE_DIRS = (
- make_absolute_path('envelope/tests/templates'),
- ),
ROOT_URLCONF = 'envelope.tests.urls',
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner',
NOSE_ARGS = ['--stop'],

0 comments on commit a197625

Please sign in to comment.