mirror of
https://github.com/django/django.git
synced 2025-08-02 18:13:02 +00:00
Fixed #32231 -- Allowed passing None params to QuerySet.raw().
This commit is contained in:
parent
aa3d360631
commit
415f50298f
5 changed files with 28 additions and 7 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue