'Operations that involve sharing FK objects across databases raise an error'

def test_o2o_cross_database_protection(self):

    alice = User.objects.db_manager('default').create_user('alice', 'alice@example.com')
    bob = User.objects.db_manager('other').create_user('bob', 'bob@example.com')
    alice_profile = UserProfile.objects.create(user=alice, flavor='chocolate')
    bob.userprofile = alice_profile
    self.assertEqual(alice._state.db, 'default')
    self.assertEqual(alice_profile._state.db, 'default')
    self.assertEqual(bob._state.db, 'other')
    bob.save()
    self.assertEqual(bob._state.db, 'default')
