From 05239180c06819b4dc8e6a1d12cbd6d50a31d1ee Mon Sep 17 00:00:00 2001 From: Adam Chainz Date: Sun, 30 Aug 2015 20:28:37 +0100 Subject: [PATCH] Removed unnecessary DBCacheTests.test_clear_commits_transaction test. Was added in 44164c5c308da32a804dfb03ce0bffde2a6b4c56 but the transaction.commit_unless_managed() line was removed in ba5138b1c0253fcf390b7509ad7b954117b3be88; thus the test does nothing but check that clear() runs. --- tests/cache/tests.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/cache/tests.py b/tests/cache/tests.py index a7e098307c..cb64dad97d 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -20,7 +20,7 @@ from django.core.cache import ( DEFAULT_CACHE_ALIAS, CacheKeyWarning, cache, caches, ) from django.core.cache.utils import make_template_fragment_key -from django.db import connection, connections, transaction +from django.db import connection, connections from django.http import HttpRequest, HttpResponse, StreamingHttpResponse from django.middleware.cache import ( CacheMiddleware, FetchFromCacheMiddleware, UpdateCacheMiddleware, @@ -971,13 +971,6 @@ class DBCacheTests(BaseCacheTests, TransactionTestCase): self.assertEqual(out.getvalue(), "Cache table 'test cache table' created.\n") - def test_clear_commits_transaction(self): - # Ensure the database transaction is committed (#19896) - cache.set("key1", "spam") - cache.clear() - transaction.rollback() - self.assertIsNone(cache.get("key1")) - @override_settings(USE_TZ=True) class DBCacheWithTimeZoneTests(DBCacheTests):