Simplified test_cursor_var() by using str instead of Database.STRING.

This commit is contained in:
Mariusz Felisiak 2019-02-12 20:10:02 +01:00 committed by GitHub
parent 543fc97407
commit 7d5d20212c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -24,9 +24,8 @@ class Tests(unittest.TestCase):
def test_cursor_var(self): def test_cursor_var(self):
"""Cursor variables can be passed as query parameters.""" """Cursor variables can be passed as query parameters."""
from django.db.backends.oracle.base import Database
with connection.cursor() as cursor: with connection.cursor() as cursor:
var = cursor.var(Database.STRING) var = cursor.var(str)
cursor.execute("BEGIN %s := 'X'; END; ", [var]) cursor.execute("BEGIN %s := 'X'; END; ", [var])
self.assertEqual(var.getvalue(), 'X') self.assertEqual(var.getvalue(), 'X')