'Queries are constrained to a single database'

def test_basic_queries(self):

    dive = Book.objects.using(u'other').create(title=u'Dive    into    Python', published=datetime.date(2009, 5, 4))
    dive = Book.objects.using(u'other').get(published=datetime.date(2009, 5, 4))
    self.assertEqual(dive.title, u'Dive    into    Python')
    self.assertRaises(Book.DoesNotExist, Book.objects.using(u'default').get, published=datetime.date(2009, 5, 4))
    dive = Book.objects.using(u'other').get(title__icontains=u'dive')
    self.assertEqual(dive.title, u'Dive    into    Python')
    self.assertRaises(Book.DoesNotExist, Book.objects.using(u'default').get, title__icontains=u'dive')
    dive = Book.objects.using(u'other').get(title__iexact=u'dive    INTO    python')
    self.assertEqual(dive.title, u'Dive    into    Python')
    self.assertRaises(Book.DoesNotExist, Book.objects.using(u'default').get, title__iexact=u'dive    INTO    python')
    dive = Book.objects.using(u'other').get(published__year=2009)
    self.assertEqual(dive.title, u'Dive    into    Python')
    self.assertEqual(dive.published, datetime.date(2009, 5, 4))
    self.assertRaises(Book.DoesNotExist, Book.objects.using(u'default').get, published__year=2009)
    years = Book.objects.using(u'other').dates(u'published', u'year')
    self.assertEqual([o.year for o in years], [2009])
    years = Book.objects.using(u'default').dates(u'published', u'year')
    self.assertEqual([o.year for o in years], [])
    months = Book.objects.using(u'other').dates(u'published', u'month')
    self.assertEqual([o.month for o in months], [5])
    months = Book.objects.using(u'default').dates(u'published', u'month')
    self.assertEqual([o.month for o in months], [])
