diff -r 2364ce5890bc tests/modeltests/raw_query/tests.py
a
|
b
|
|
169 | 169 | authors = Author.objects.all() |
170 | 170 | self.assertSuccessfulRawQuery(Author, query, authors, expected_annotations) |
171 | 171 | |
| 172 | def testJoin(self): |
| 173 | query = "SELECT a.id, a.first_name FROM raw_query_author a INNER JOIN raw_query_book b ON a.id = b.author_id" |
| 174 | authors = Author.objects.filter(book__isnull=False) |
| 175 | self.assertSuccessfulRawQuery(Author, query, authors) |
| 176 | |
172 | 177 | def testInvalidQuery(self): |
173 | 178 | query = "UPDATE raw_query_author SET first_name='thing' WHERE first_name='Joe'" |
174 | 179 | self.assertRaises(InvalidQuery, Author.objects.raw, query) |