summaryrefslogtreecommitdiff
path: root/tests/handlers
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-05-19 17:55:12 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-05-19 19:53:16 +0200
commit6633eeb88634aa8c03c8737d2d23c96b96a37e0d (patch)
tree96d3e96cf471286afe9273101c50fe91be0aa500 /tests/handlers
parentbdde7feb26f89e580c2b21154196fe3f8c774677 (diff)
downloaddjango-6633eeb88634aa8c03c8737d2d23c96b96a37e0d.tar.gz
Changed API to disable ATOMIC_REQUESTS per view.
A decorator is easier to apply to CBVs. Backwards compatibility isn't an issue here, except for people running on a recent clone of master. Fixed a few minor problems in the transactions docs while I was there.
Diffstat (limited to 'tests/handlers')
-rw-r--r--tests/handlers/views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/handlers/views.py b/tests/handlers/views.py
index 22d9ea4c7d..9cc86ae6f3 100644
--- a/tests/handlers/views.py
+++ b/tests/handlers/views.py
@@ -1,6 +1,6 @@
from __future__ import unicode_literals
-from django.db import connection
+from django.db import connection, transaction
from django.http import HttpResponse, StreamingHttpResponse
def regular(request):
@@ -12,6 +12,6 @@ def streaming(request):
def in_transaction(request):
return HttpResponse(str(connection.in_atomic_block))
+@transaction.non_atomic_requests
def not_in_transaction(request):
return HttpResponse(str(connection.in_atomic_block))
-not_in_transaction.transactions_per_request = False