Skip to content

Commit

Permalink
Refs #34881 -- Fixed OperationTests.test_rename_m2m_field_with_2_refe…
Browse files Browse the repository at this point in the history
…rences() test on Oracle.
  • Loading branch information
felixxm authored and sarahboyce committed Jun 14, 2024
1 parent 4ee68bb commit fa78481
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/migrations/test_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ def test_rename_m2m_model_after_rename_field(self):
ponyrider.riders.add(jockey)

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(
app_label,
ProjectState(),
Expand Down Expand Up @@ -1383,15 +1383,15 @@ def test_rename_m2m_field_with_2_references(self):
models.ForeignKey(
on_delete=models.CASCADE,
related_name="relations_as_child",
to="test_rename_multiple_references.person",
to=f"{app_label}.person",
),
),
(
"parent",
models.ForeignKey(
on_delete=models.CASCADE,
related_name="relations_as_parent",
to="test_rename_multiple_references.person",
to=f"{app_label}.person",
),
),
],
Expand All @@ -1401,8 +1401,8 @@ def test_rename_m2m_field_with_2_references(self):
name="parents_or_children",
field=models.ManyToManyField(
blank=True,
through="test_rename_multiple_references.Relation",
to="test_rename_multiple_references.person",
through=f"{app_label}.Relation",
to=f"{app_label}.person",
),
),
],
Expand All @@ -1415,18 +1415,18 @@ def test_rename_m2m_field_with_2_references(self):
Relation.objects.create(child=person2, parent=person1)

self.assertTableExists(app_label + "_person")
self.assertTableNotExists(app_label + "_personfoo")
self.assertTableNotExists(app_label + "_other")

self.apply_operations(
app_label,
project_state,
operations=[
migrations.RenameModel(old_name="Person", new_name="PersonFoo"),
migrations.RenameModel(old_name="Person", new_name="Other"),
],
)

self.assertTableNotExists(app_label + "_person")
self.assertTableExists(app_label + "_personfoo")
self.assertTableExists(app_label + "_other")

def test_add_field(self):
"""
Expand Down

0 comments on commit fa78481

Please sign in to comment.