summaryrefslogtreecommitdiff
path: root/tests/raw_query
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-04 08:08:27 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-07 20:37:05 +0100
commit7119f40c9881666b6f9b5cf7df09ee1d21cc8344 (patch)
treefa50869f5614295f462d9bf77fec59365c621609 /tests/raw_query
parent9c19aff7c7561e3a82978a272ecdaad40dda5c00 (diff)
Refs #33476 -- Refactored code to strictly match 88 characters line length.
Diffstat (limited to 'tests/raw_query')
-rw-r--r--tests/raw_query/tests.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/raw_query/tests.py b/tests/raw_query/tests.py
index 24c96b5954..ebbf31a8c8 100644
--- a/tests/raw_query/tests.py
+++ b/tests/raw_query/tests.py
@@ -35,7 +35,10 @@ class RawQueryTests(TestCase):
title="The awesome book",
author=cls.a1,
paperback=False,
- opening_line="It was a bright cold day in April and the clocks were striking thirteen.",
+ opening_line=(
+ "It was a bright cold day in April and the clocks were striking "
+ "thirteen."
+ ),
)
cls.b2 = Book.objects.create(
title="The horrible book",
@@ -193,7 +196,10 @@ class RawQueryTests(TestCase):
Test of raw query's optional ability to translate unexpected result
column names to specific model fields
"""
- query = "SELECT first_name AS first, last_name AS last, dob, id FROM raw_query_author"
+ query = (
+ "SELECT first_name AS first, last_name AS last, dob, id "
+ "FROM raw_query_author"
+ )
translations = {"first": "first_name", "last": "last_name"}
authors = Author.objects.all()
self.assertSuccessfulRawQuery(Author, query, authors, translations=translations)
@@ -358,7 +364,8 @@ class RawQueryTests(TestCase):
def test_subquery_in_raw_sql(self):
list(
Book.objects.raw(
- "SELECT id FROM (SELECT * FROM raw_query_book WHERE paperback IS NOT NULL) sq"
+ "SELECT id FROM "
+ "(SELECT * FROM raw_query_book WHERE paperback IS NOT NULL) sq"
)
)