diff options
| author | Jason Pellerin <jpellerin@gmail.com> | 2006-07-23 04:01:15 +0000 |
|---|---|---|
| committer | Jason Pellerin <jpellerin@gmail.com> | 2006-07-23 04:01:15 +0000 |
| commit | 94ccedf364ff91a11fdbdc722c2e33857a84a72d (patch) | |
| tree | 938e8e0caeb7a11c8690a71ddc1bbd41b67c1ef2 /tests/othertests/request_isolation.py | |
| parent | 5b964baa1479b844678a0564efbc1e1435b565d3 (diff) | |
[multi-db] Corrected settings handling in isolation tests.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3429 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/othertests/request_isolation.py')
| -rw-r--r-- | tests/othertests/request_isolation.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/othertests/request_isolation.py b/tests/othertests/request_isolation.py index 9277dea9a1..6c29306c4e 100644 --- a/tests/othertests/request_isolation.py +++ b/tests/othertests/request_isolation.py @@ -1,7 +1,7 @@ # tests that db settings can change between requests import copy import os -from django.conf import settings +from django.conf import settings, UserSettingsHolder from django.core.handlers.wsgi import WSGIHandler from django.db import models, model_connection_name, _default, connection from django.http import HttpResponse @@ -91,19 +91,15 @@ def debug(*arg): def setup(): debug("setup") - S['ODB'] = copy.deepcopy(settings.OTHER_DATABASES) - for sk in [ k for k in dir(settings) if k.startswith('DATABASE') ]: - S[sk] = getattr(settings, sk) - + S['settings'] = settings._target + settings._target = UserSettingsHolder(copy.deepcopy(settings._target)) settings.OTHER_DATABASES['django_test_db_a']['MODELS'] = ['ri.MX'] settings.OTHER_DATABASES['django_test_db_b']['MODELS'] = ['ri.MY'] def teardown(): debug("teardown") - settings.OTHER_DATABASES = S['ODB'] - for sk in [ k for k in S.keys() if k.startswith('DATABASE') ]: - setattr(settings, sk, S[sk]) + settings._target = S['settings'] def start_response(code, headers): |
