mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #32653 -- Made quoting names in the Oracle backend consistent with db_table.
This commit is contained in:
parent
54da6e2ac2
commit
1f643c28b5
2 changed files with 11 additions and 2 deletions
|
@ -4,7 +4,9 @@ from django.db import DatabaseError, connection
|
|||
from django.db.models import BooleanField
|
||||
from django.test import TransactionTestCase
|
||||
|
||||
from ..models import Square
|
||||
from ..models import (
|
||||
Square, VeryLongModelNameZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ,
|
||||
)
|
||||
|
||||
|
||||
@unittest.skipUnless(connection.vendor == 'oracle', 'Oracle tests')
|
||||
|
@ -16,6 +18,13 @@ class Tests(unittest.TestCase):
|
|||
quoted_name = connection.ops.quote_name(name)
|
||||
self.assertEqual(quoted_name % (), name)
|
||||
|
||||
def test_quote_name_db_table(self):
|
||||
model = VeryLongModelNameZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
|
||||
db_table = model._meta.db_table.upper()
|
||||
self.assertEqual(f'"{db_table}"', connection.ops.quote_name(
|
||||
'backends_verylongmodelnamezzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz',
|
||||
))
|
||||
|
||||
def test_dbms_session(self):
|
||||
"""A stored procedure can be called through a cursor wrapper."""
|
||||
with connection.cursor() as cursor:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue