Commits

Peter Wright committed 0252717

Changed tests.{backends,models,views} test cases to use test-templates dir for TEMPLATE_DIRS.

  • Participants
  • Parent commits f5fac8b

Comments (0)

Files changed (3)

File registration/tests/backends.py

+import os
 import datetime
 
 from django.conf import settings
         self.old_activation = getattr(settings, 'ACCOUNT_ACTIVATION_DAYS', None)
         if self.old_activation is None:
             settings.ACCOUNT_ACTIVATION_DAYS = 7  # pragma: no cover
+        self.old_template_dirs = getattr(settings, 'TEMPLATE_DIRS')
+        settings.TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), 'templates'),)
 
     def tearDown(self):
         """
         """
         if self.old_activation is None:
             settings.ACCOUNT_ACTIVATION_DAYS = self.old_activation  # pragma: no cover
+        settings.TEMPLATE_DIRS = self.old_template_dirs
 
     def test_registration(self):
         """

File registration/tests/models.py

+import os
 import datetime
 import re
 
     def setUp(self):
         self.old_activation = getattr(settings, 'ACCOUNT_ACTIVATION_DAYS', None)
         settings.ACCOUNT_ACTIVATION_DAYS = 7
+        self.old_template_dirs = getattr(settings, 'TEMPLATE_DIRS')
+        settings.TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), 'templates'),)
 
     def tearDown(self):
         settings.ACCOUNT_ACTIVATION_DAYS = self.old_activation
+        settings.TEMPLATE_DIRS = self.old_template_dirs
 
     def test_profile_creation(self):
         """

File registration/tests/views.py

     def setUp(self):
         self.old_registration_open = settings.REGISTRATION_OPEN
         settings.REGISTRATION_OPEN = True
+        self.old_template_dirs = getattr(settings, 'TEMPLATE_DIRS')
+        settings.TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), 'templates'),)
 
     def tearDown(self):
         settings.REGISTRATION_OPEN = self.old_registration_open
+        settings.TEMPLATE_DIRS = self.old_template_dirs
 
     def test_registration_view_initial(self):
         """