Code

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

File 19095-show-invalid-result.diff, 880 bytes (added by aaugustin, 19 months ago)
Line 
1diff --git a/tests/regressiontests/multiple_database/tests.py b/tests/regressiontests/multiple_database/tests.py
2index 782fe2b..5937937 100644
3--- a/tests/regressiontests/multiple_database/tests.py
4+++ b/tests/regressiontests/multiple_database/tests.py
5@@ -675,6 +675,12 @@ class QueryTestCase(TestCase):
6         charlie.save()
7         bob_profile.save()
8         new_bob_profile.save()
9+
10+        # Reload Charlie to clear the related objects cache
11+        charlie_reloaded = User.objects.using('other').get(pk=charlie.pk)
12+        # Argh, the profile wasn't actually saved!
13+        self.assertEqual(charlie_reloaded.userprofile, bob_profile)
14+
15         self.assertEqual(list(User.objects.using('default').values_list('username',flat=True)),
16                           ['alice'])
17         self.assertEqual(list(User.objects.using('other').values_list('username',flat=True)),