mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #32231 -- Allowed passing None params to QuerySet.raw().
This commit is contained in:
committed by
Mariusz Felisiak
parent
aa3d360631
commit
415f50298f
@@ -180,6 +180,11 @@ class RawQueryTests(TestCase):
|
||||
self.assertEqual(len(results), 1)
|
||||
self.assertIsInstance(repr(qset), str)
|
||||
|
||||
def test_params_none(self):
|
||||
query = "SELECT * FROM raw_query_author WHERE first_name like 'J%'"
|
||||
qset = Author.objects.raw(query, params=None)
|
||||
self.assertEqual(len(qset), 2)
|
||||
|
||||
def test_escaped_percent(self):
|
||||
query = "SELECT * FROM raw_query_author WHERE first_name like 'J%%'"
|
||||
qset = Author.objects.raw(query)
|
||||
|
||||
Reference in New Issue
Block a user