|
@@ -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
|