~jbaker/storm/nose_plugin

« back to all changes in this revision

Viewing changes to tests/django/middleware.py

  • Committer: Jamu Kakar
  • Date: 2009-11-24 18:34:34 UTC
  • mfrom: (340 storm.trunk)
  • mto: This revision was merged to the branch mainline in revision 341.
  • Revision ID: jkakar@kakar.ca-20091124183434-ambkvw9tp2byvjnc
- Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#
21
21
 
22
22
try:
23
 
    from django import conf
24
 
    from django.http import HttpRequest, HttpResponse
 
23
    import django
25
24
    import transaction
26
25
except ImportError:
27
26
    have_django_and_transaction = False
28
27
else:
29
28
    have_django_and_transaction = True
 
29
    from django import conf
 
30
    from django.http import HttpRequest, HttpResponse
30
31
    from storm.django.middleware import ZopeTransactionMiddleware
31
32
 
32
33
from tests.helper import TestHelper
44
45
        self.django_transaction = django_transaction
45
46
 
46
47
    def tearDown(self):
47
 
        conf.settings._target = None
 
48
        if django.VERSION >= (1, 1):
 
49
            conf.settings._wrapped = None
 
50
        else:
 
51
            conf.settings._target = None
48
52
        super(TransactionMiddlewareTests, self).tearDown()
49
53
 
50
54
    def test_process_request_begins_transaction(self):