Ticket #13710: 13710.diff

File 13710.diff, 811 bytes (added by Tobias McNulty, 14 years ago)

same patch, named for this bug (not the duplicate)

  • tests/modeltests/raw_query/tests.py

    diff -r 2364ce5890bc tests/modeltests/raw_query/tests.py
    a b  
    169169        authors = Author.objects.all()
    170170        self.assertSuccessfulRawQuery(Author, query, authors, expected_annotations)
    171171
     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
    172177    def testInvalidQuery(self):
    173178        query = "UPDATE raw_query_author SET first_name='thing' WHERE first_name='Joe'"
    174179        self.assertRaises(InvalidQuery, Author.objects.raw, query)
Back to Top