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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user