diff options
author | Anssi Kääriäinen <anssi.kaariainen@thl.fi> | 2015-02-26 16:19:17 +0200 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-03-25 08:16:12 -0400 |
commit | 8f30556329b64005d63b66859a74752a0b261315 (patch) | |
tree | 73b5ac8d3be457f8061aa270437c9a957d2d622c /tests/many_to_one | |
parent | f9c70bb3a1239ed1e04a769fd323286a5b1fde20 (diff) | |
download | django-8f30556329b64005d63b66859a74752a0b261315.tar.gz |
Renamed Field.rel attribute to remote_field
Field.rel is now deprecated. Rel objects have now also remote_field
attribute. This means that self == self.remote_field.remote_field.
In addition, made the Rel objects a bit more like Field objects. Still,
marked ManyToManyFields as null=True.
Diffstat (limited to 'tests/many_to_one')
-rw-r--r-- | tests/many_to_one/tests.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/many_to_one/tests.py b/tests/many_to_one/tests.py index af7503fba8..d828abe8c2 100644 --- a/tests/many_to_one/tests.py +++ b/tests/many_to_one/tests.py @@ -565,12 +565,12 @@ class ManyToOneTests(TestCase): p = Parent() with self.assertRaisesMessage(ValueError, 'Cannot assign "%r": "%s" instance isn\'t saved in the database.' - % (p, Child.parent.field.rel.to._meta.object_name)): + % (p, Child.parent.field.remote_field.model._meta.object_name)): Child(parent=p) with self.assertRaisesMessage(ValueError, 'Cannot assign "%r": "%s" instance isn\'t saved in the database.' - % (p, Child.parent.field.rel.to._meta.object_name)): + % (p, Child.parent.field.remote_field.model._meta.object_name)): ToFieldChild(parent=p) # Creation using attname keyword argument and an id will cause the @@ -610,7 +610,7 @@ class ManyToOneTests(TestCase): # Regression for #12190 -- Should be able to instantiate a FK outside # of a model, and interrogate its related field. cat = models.ForeignKey(Category) - self.assertEqual('id', cat.rel.get_related_field().name) + self.assertEqual('id', cat.remote_field.get_related_field().name) def test_relation_unsaved(self): # Test that the <field>_set manager does not join on Null value fields (#17541) |