1. Carl Meyer
  2. django-localeurl


Carl Meyer  committed 2fbc5a6

Remove bits of TestSettingsManager that won't work in recent Django version.

  • Participants
  • Parent commits f6a6cbc
  • Branches default

Comments (0)

Files changed (1)

File localeurl/tests/test_utils.py

View file
-Test settings manager, originally copied from a `Django snippet`_ by 'carljm'.
+Test utilities.
-.. _`Django snippet`: http://www.djangosnippets.org/snippets/1011/
 from django.conf import settings as django_settings
 from django.core.handlers.wsgi import WSGIRequest
-from django.core.management import call_command
-from django.db.models import loading
 from django import template
 from django.test import Client
 from django.utils import encoding
     A class which can modify some Django settings temporarily for a
     test and then revert them to their original values later.
-    Automatically handles resyncing the DB if INSTALLED_APPS is
-    modified.
     Based on the work by 'carljm':
         self._settings = settings
         self._original_settings = {}
     def set(self, **kwargs):
     def set_from_dict(self, settings):
         for k,v in settings.iteritems():
                     getattr(self._settings, k, NO_SETTING))
             setattr(self._settings, k, v)
-        if 'INSTALLED_APPS' in settings:
-            self.syncdb()
-    def syncdb(self):
-        loading.cache.loaded = False
-        call_command('syncdb', verbosity=0)
     def revert(self):
         for k,v in self._original_settings.iteritems():
                     delattr(self._settings._wrapped, k)
                 setattr(self._settings, k, v)
-        if self._settings == django_settings \
-                and 'INSTALLED_APPS' in self._original_settings:
-            self.syncdb()
         self._original_settings = {}
 class RequestFactory(Client):
     Class that lets you create mock Request objects for use in testing.