'Cascaded deletions of Foreign Key relations issue queries on the right database'

def test_foreign_key_deletion(self):

    mark = Person.objects.using('other').create(name='Mark    Pilgrim')
    fido = Pet.objects.using('other').create(name='Fido', owner=mark)
    self.assertEqual(Person.objects.using('default').count(), 0)
    self.assertEqual(Pet.objects.using('default').count(), 0)
    self.assertEqual(Person.objects.using('other').count(), 1)
    self.assertEqual(Pet.objects.using('other').count(), 1)
    mark.delete(using='other')
    self.assertEqual(Person.objects.using('default').count(), 0)
    self.assertEqual(Pet.objects.using('default').count(), 0)
    self.assertEqual(Person.objects.using('other').count(), 0)
    self.assertEqual(Pet.objects.using('other').count(), 0)
