summaryrefslogtreecommitdiff
path: root/tests/handlers/tests.py
diff options
context:
space:
mode:
authorPablo <pablo22estevez@gmail.com>2022-12-02 23:04:42 -0300
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-12-05 10:46:33 +0100
commit48531f53ae9c5781094c91b6aaec204920359018 (patch)
tree544a3f9bd1ecc0f779962067456bb18cf6506a8b /tests/handlers/tests.py
parent344593893b6fc5fdda45a74013fc8622401c5058 (diff)
Improved test coverage for django.db.transaction.
Diffstat (limited to 'tests/handlers/tests.py')
-rw-r--r--tests/handlers/tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/handlers/tests.py b/tests/handlers/tests.py
index 1e2da4672b..980887edfd 100644
--- a/tests/handlers/tests.py
+++ b/tests/handlers/tests.py
@@ -129,6 +129,19 @@ class TransactionsPerRequestTests(TransactionTestCase):
finally:
connection.settings_dict["ATOMIC_REQUESTS"] = old_atomic_requests
self.assertContains(response, "False")
+ try:
+ connection.settings_dict["ATOMIC_REQUESTS"] = True
+ response = self.client.get("/not_in_transaction_using_none/")
+ finally:
+ connection.settings_dict["ATOMIC_REQUESTS"] = old_atomic_requests
+ self.assertContains(response, "False")
+ try:
+ connection.settings_dict["ATOMIC_REQUESTS"] = True
+ response = self.client.get("/not_in_transaction_using_text/")
+ finally:
+ connection.settings_dict["ATOMIC_REQUESTS"] = old_atomic_requests
+ # The non_atomic_requests decorator is used for an incorrect table.
+ self.assertContains(response, "True")
@override_settings(ROOT_URLCONF="handlers.urls")