mirror of
https://github.com/django/django.git
synced 2025-03-31 19:46:42 +00:00
[5.1.x] Refs #34881 -- Fixed OperationTests.test_rename_m2m_field_with_2_references() test on Oracle.
Backport of fa7848146738a9fe1d415ee4808664e54739eeb7 from main.
This commit is contained in:
parent
06f0141691
commit
a0f6835f72
@ -1346,7 +1346,7 @@ class OperationTests(OperationTestBase):
|
|||||||
ponyrider.riders.add(jockey)
|
ponyrider.riders.add(jockey)
|
||||||
|
|
||||||
def test_rename_m2m_field_with_2_references(self):
|
def test_rename_m2m_field_with_2_references(self):
|
||||||
app_label = "test_rename_multiple_references"
|
app_label = "test_rename_many_refs"
|
||||||
project_state = self.apply_operations(
|
project_state = self.apply_operations(
|
||||||
app_label,
|
app_label,
|
||||||
ProjectState(),
|
ProjectState(),
|
||||||
@ -1383,7 +1383,7 @@ class OperationTests(OperationTestBase):
|
|||||||
models.ForeignKey(
|
models.ForeignKey(
|
||||||
on_delete=models.CASCADE,
|
on_delete=models.CASCADE,
|
||||||
related_name="relations_as_child",
|
related_name="relations_as_child",
|
||||||
to="test_rename_multiple_references.person",
|
to=f"{app_label}.person",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
@ -1391,7 +1391,7 @@ class OperationTests(OperationTestBase):
|
|||||||
models.ForeignKey(
|
models.ForeignKey(
|
||||||
on_delete=models.CASCADE,
|
on_delete=models.CASCADE,
|
||||||
related_name="relations_as_parent",
|
related_name="relations_as_parent",
|
||||||
to="test_rename_multiple_references.person",
|
to=f"{app_label}.person",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -1401,8 +1401,8 @@ class OperationTests(OperationTestBase):
|
|||||||
name="parents_or_children",
|
name="parents_or_children",
|
||||||
field=models.ManyToManyField(
|
field=models.ManyToManyField(
|
||||||
blank=True,
|
blank=True,
|
||||||
through="test_rename_multiple_references.Relation",
|
through=f"{app_label}.Relation",
|
||||||
to="test_rename_multiple_references.person",
|
to=f"{app_label}.person",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -1415,18 +1415,18 @@ class OperationTests(OperationTestBase):
|
|||||||
Relation.objects.create(child=person2, parent=person1)
|
Relation.objects.create(child=person2, parent=person1)
|
||||||
|
|
||||||
self.assertTableExists(app_label + "_person")
|
self.assertTableExists(app_label + "_person")
|
||||||
self.assertTableNotExists(app_label + "_personfoo")
|
self.assertTableNotExists(app_label + "_other")
|
||||||
|
|
||||||
self.apply_operations(
|
self.apply_operations(
|
||||||
app_label,
|
app_label,
|
||||||
project_state,
|
project_state,
|
||||||
operations=[
|
operations=[
|
||||||
migrations.RenameModel(old_name="Person", new_name="PersonFoo"),
|
migrations.RenameModel(old_name="Person", new_name="Other"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertTableNotExists(app_label + "_person")
|
self.assertTableNotExists(app_label + "_person")
|
||||||
self.assertTableExists(app_label + "_personfoo")
|
self.assertTableExists(app_label + "_other")
|
||||||
|
|
||||||
def test_add_field(self):
|
def test_add_field(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user