Ticket #19095: 19095-show-invalid-result.diff

File 19095-show-invalid-result.diff, 880 bytes (added by Aymeric Augustin, 12 years ago)
  • tests/regressiontests/multiple_database/tests.py

    diff --git a/tests/regressiontests/multiple_database/tests.py b/tests/regressiontests/multiple_database/tests.py
    index 782fe2b..5937937 100644
    a b class QueryTestCase(TestCase):  
    675675        charlie.save()
    676676        bob_profile.save()
    677677        new_bob_profile.save()
     678
     679        # Reload Charlie to clear the related objects cache
     680        charlie_reloaded = User.objects.using('other').get(pk=charlie.pk)
     681        # Argh, the profile wasn't actually saved!
     682        self.assertEqual(charlie_reloaded.userprofile, bob_profile)
     683
    678684        self.assertEqual(list(User.objects.using('default').values_list('username',flat=True)),
    679685                          ['alice'])
    680686        self.assertEqual(list(User.objects.using('other').values_list('username',flat=True)),
Back to Top