Ticket #12717: as_sql.diff

File as_sql.diff, 998 bytes (added by Jeff Balogh, 14 years ago)

Failing test for as_sql with multi-db and master/slave

  • tests/regressiontests/multiple_database/tests.py

    diff --git a/tests/regressiontests/multiple_database/tests.py b/tests/regressiontests/multiple_database/tests.py
    index fd6e644..d3671e0 100644
    a b class RouterTestCase(TestCase):  
    11071107        review3.content_object = dive
    11081108        self.assertEquals(review3._state.db, 'default')
    11091109
     1110    def test_as_sql_with_subquery(self):
     1111        """Make sure as_sql works with subqueries and master/slave."""
     1112        sub = Person.objects.filter(name='fff')
     1113        qs = Book.objects.filter(editor__in=sub)
     1114
     1115        # When you call __str__ on the query object, it doesn't know about using
     1116        # so it falls back to the default.  But the subquery knows what database
     1117        # to use (not the default), so it looks like the subquery is going to a
     1118        # different db than the superquery.
     1119        str(qs.query)
     1120
    11101121
    11111122class UserProfileTestCase(TestCase):
    11121123    def setUp(self):
Back to Top