1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #28206 -- Fixed RawQuerySet crash on a model with a mixed case db_column pk on Oracle.

Thanks Tim Graham for the review.
This commit is contained in:
Mariusz Felisiak
2017-05-18 19:11:23 +02:00
committed by GitHub
parent 98b3b14a64
commit 99df304c85
3 changed files with 19 additions and 3 deletions

View File

@@ -5,7 +5,10 @@ from django.db.models.query import RawQuerySet
from django.db.models.query_utils import InvalidQuery
from django.test import TestCase, skipUnlessDBFeature
from .models import Author, Book, BookFkAsPk, Coffee, FriendlyAuthor, Reviewer
from .models import (
Author, Book, BookFkAsPk, Coffee, FriendlyAuthor, MixedCaseIDColumn,
Reviewer,
)
class RawQueryTests(TestCase):
@@ -129,6 +132,14 @@ class RawQueryTests(TestCase):
coffees = Coffee.objects.all()
self.assertSuccessfulRawQuery(Coffee, query, coffees)
def test_pk_with_mixed_case_db_column(self):
"""
A raw query with a model that has a pk db_column with mixed case.
"""
query = "SELECT * FROM raw_query_mixedcaseidcolumn"
queryset = MixedCaseIDColumn.objects.all()
self.assertSuccessfulRawQuery(MixedCaseIDColumn, query, queryset)
def test_order_handler(self):
"""
Test of raw raw query's tolerance for columns being returned in any