mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Refs #28584 -- Removed unused DatabaseFeatures.can_share_in_memory_db.
This commit is contained in:
parent
a2626cb3fe
commit
d0c761d3f8
4 changed files with 6 additions and 33 deletions
|
@ -2,12 +2,9 @@ import re
|
|||
import threading
|
||||
import unittest
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.db import connection
|
||||
from django.db.models import Avg, StdDev, Sum, Variance
|
||||
from django.test import (
|
||||
TestCase, TransactionTestCase, override_settings, skipUnlessDBFeature,
|
||||
)
|
||||
from django.test import TestCase, TransactionTestCase, override_settings
|
||||
|
||||
from ..models import Item, Object, Square
|
||||
|
||||
|
@ -56,19 +53,8 @@ class Tests(TestCase):
|
|||
'NAME': 'file:memorydb_test?mode=memory&cache=shared',
|
||||
}
|
||||
}
|
||||
wrapper = DatabaseWrapper(settings_dict)
|
||||
creation = wrapper.creation
|
||||
if creation.connection.features.can_share_in_memory_db:
|
||||
expected = creation.connection.settings_dict['TEST']['NAME']
|
||||
self.assertEqual(creation._get_test_db_name(), expected)
|
||||
else:
|
||||
msg = (
|
||||
"Using a shared memory database with `mode=memory` in the "
|
||||
"database name is not supported in your environment, "
|
||||
"use `:memory:` instead."
|
||||
)
|
||||
with self.assertRaisesMessage(ImproperlyConfigured, msg):
|
||||
creation._get_test_db_name()
|
||||
creation = DatabaseWrapper(settings_dict).creation
|
||||
self.assertEqual(creation._get_test_db_name(), creation.connection.settings_dict['TEST']['NAME'])
|
||||
|
||||
|
||||
@unittest.skipUnless(connection.vendor == 'sqlite', 'Test only for SQLite')
|
||||
|
@ -124,7 +110,6 @@ class EscapingChecksDebug(EscapingChecks):
|
|||
|
||||
|
||||
@unittest.skipUnless(connection.vendor == 'sqlite', 'SQLite tests')
|
||||
@skipUnlessDBFeature('can_share_in_memory_db')
|
||||
class ThreadSharing(TransactionTestCase):
|
||||
available_apps = ['backends']
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue