mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
[1.7.x] Fixed #23089 -- Fixed transaction handling in two management commands.
Previously, when createcachetable and flush operated on non-default
databases, they weren't atomic.
Backport of 753a22a635 from master
This commit is contained in:
committed by
Tim Graham
parent
b918bc921c
commit
5ca82ff71b
8
tests/cache/tests.py
vendored
8
tests/cache/tests.py
vendored
@@ -989,9 +989,11 @@ class CreateCacheTableForDBCacheTests(TestCase):
|
||||
# cache table should be created on 'other'
|
||||
# Queries:
|
||||
# 1: check table doesn't already exist
|
||||
# 2: create the table
|
||||
# 3: create the index
|
||||
with self.assertNumQueries(3, using='other'):
|
||||
# 2: create savepoint
|
||||
# 3: create the table
|
||||
# 4: create the index
|
||||
# 5: release savepoint
|
||||
with self.assertNumQueries(5, using='other'):
|
||||
management.call_command('createcachetable',
|
||||
database='other',
|
||||
verbosity=0, interactive=False)
|
||||
|
||||
Reference in New Issue
Block a user