diff options
author | Dražen Odobašić <dodobas@candela-it.com> | 2015-09-11 19:33:12 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-09-12 11:40:50 -0400 |
commit | b1e33ceceda1e75ff68c7deed8f6659683a195d3 (patch) | |
tree | e4e446f69194f2dc3c9c7ee3ecf48290ea8d4d31 /tests/raw_query | |
parent | 84b0a8d2aad042fb573df5055b6153770d0929ac (diff) | |
download | django-b1e33ceceda1e75ff68c7deed8f6659683a195d3.tar.gz |
Fixed #23395 -- Limited line lengths to 119 characters.
Diffstat (limited to 'tests/raw_query')
-rw-r--r-- | tests/raw_query/tests.py | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/tests/raw_query/tests.py b/tests/raw_query/tests.py index 94f21f9a71..2f80c23f32 100644 --- a/tests/raw_query/tests.py +++ b/tests/raw_query/tests.py @@ -16,10 +16,26 @@ class RawQueryTests(TestCase): cls.a2 = Author.objects.create(first_name='Jill', last_name='Doe', dob=date(1920, 4, 2)) cls.a3 = Author.objects.create(first_name='Bob', last_name='Smith', dob=date(1986, 1, 25)) cls.a4 = Author.objects.create(first_name='Bill', last_name='Jones', dob=date(1932, 5, 10)) - cls.b1 = Book.objects.create(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.') - cls.b2 = Book.objects.create(title='The horrible book', author=cls.a1, paperback=True, opening_line='On an evening in the latter part of May a middle-aged man was walking homeward from Shaston to the village of Marlott, in the adjoining Vale of Blakemore, or Blackmoor.') - cls.b3 = Book.objects.create(title='Another awesome book', author=cls.a1, paperback=False, opening_line='A squat grey building of only thirty-four stories.') - cls.b4 = Book.objects.create(title='Some other book', author=cls.a3, paperback=True, opening_line='It was the day my grandmother exploded.') + cls.b1 = Book.objects.create( + 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.', + ) + cls.b2 = Book.objects.create( + title='The horrible book', author=cls.a1, paperback=True, + opening_line=( + 'On an evening in the latter part of May a middle-aged man ' + 'was walking homeward from Shaston to the village of Marlott, ' + 'in the adjoining Vale of Blakemore, or Blackmoor.' + ), + ) + cls.b3 = Book.objects.create( + title='Another awesome book', author=cls.a1, paperback=False, + opening_line='A squat grey building of only thirty-four stories.', + ) + cls.b4 = Book.objects.create( + title='Some other book', author=cls.a3, paperback=True, + opening_line='It was the day my grandmother exploded.', + ) cls.c1 = Coffee.objects.create(brand='dunkin doughnuts') cls.c2 = Coffee.objects.create(brand='starbucks') cls.r1 = Reviewer.objects.create() @@ -211,7 +227,12 @@ class RawQueryTests(TestCase): pass def test_annotations(self): - query = "SELECT a.*, count(b.id) as book_count FROM raw_query_author a LEFT JOIN raw_query_book b ON a.id = b.author_id GROUP BY a.id, a.first_name, a.last_name, a.dob ORDER BY a.id" + query = ( + "SELECT a.*, count(b.id) as book_count " + "FROM raw_query_author a " + "LEFT JOIN raw_query_book b ON a.id = b.author_id " + "GROUP BY a.id, a.first_name, a.last_name, a.dob ORDER BY a.id" + ) expected_annotations = ( ('book_count', 3), ('book_count', 0), |