1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.7.x] Fixed #22659 -- Prevent model states from sharing field instances.

Thanks to Trac alias tbartelmess for the report and the test project.

Backport of 7a38f88922 from master
This commit is contained in:
Simon Charette
2014-05-22 18:51:11 -04:00
parent ad408d0985
commit 33511662dd
3 changed files with 34 additions and 11 deletions

View File

@@ -239,7 +239,7 @@ class AutodetectorTests(TestCase):
action = migration.operations[0]
self.assertEqual(action.__class__.__name__, "AlterField")
self.assertEqual(action.name, "author")
self.assertEqual(action.field.rel.to.__name__, "Writer")
self.assertEqual(action.field.rel.to, "testapp.Writer")
def test_rename_model_with_renamed_rel_field(self):
"""
@@ -276,7 +276,7 @@ class AutodetectorTests(TestCase):
action = migration.operations[1]
self.assertEqual(action.__class__.__name__, "AlterField")
self.assertEqual(action.name, "writer")
self.assertEqual(action.field.rel.to.__name__, "Writer")
self.assertEqual(action.field.rel.to, "testapp.Writer")
def test_fk_dependency(self):
"Tests that having a ForeignKey automatically adds a dependency"