1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Removed a primary key value dependency in a multiple_database test.

Follow up to a51c4de194.
This commit is contained in:
Tim Graham 2017-07-31 13:28:14 -04:00
parent aadd3aeb2b
commit e3bd328b0f

View File

@ -672,8 +672,8 @@ class QueryTestCase(TestCase):
# Set a one-to-one relation with an object from a different database # Set a one-to-one relation with an object from a different database
alice_profile = UserProfile.objects.using('default').create(user=alice, flavor='chocolate') alice_profile = UserProfile.objects.using('default').create(user=alice, flavor='chocolate')
msg = ( msg = (
'Cannot assign "<UserProfile: UserProfile object (1)>": the ' 'Cannot assign "%r": the current database router prevents this '
'current database router prevents this relation.' 'relation.' % alice_profile
) )
with self.assertRaisesMessage(ValueError, msg): with self.assertRaisesMessage(ValueError, msg):
bob.userprofile = alice_profile bob.userprofile = alice_profile