Skip to content

Commit 94f9b4b

Browse files
committed
Fix mock assertions in migration tests
1 parent 189b6d3 commit 94f9b4b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_migrations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Meta:
6868
monkeypatch.setattr(migration, "to_picture_field", Mock())
6969
migration.alter_picture_field(FromModel, ToModel)
7070

71-
assert migration.to_picture_field.called_once_with(ToModel)
71+
migration.to_picture_field.assert_called_once_with(FromModel, ToModel)
7272

7373
def test_alter_picture_field__picture_to_image(self, request, monkeypatch):
7474
class FromModel(models.Model):
@@ -87,7 +87,7 @@ class Meta:
8787
monkeypatch.setattr(migration, "from_picture_field", Mock())
8888
migration.alter_picture_field(FromModel, ToModel)
8989

90-
assert migration.from_picture_field.called_once_with(FromModel)
90+
migration.from_picture_field.assert_called_once_with(FromModel)
9191

9292
def test_alter_picture_field__picture_to_picture(self, request, monkeypatch):
9393
class FromModel(models.Model):
@@ -108,7 +108,7 @@ class Meta:
108108
monkeypatch.setattr(migration, "to_picture_field", Mock())
109109
migration.alter_picture_field(FromModel, ToModel)
110110
from_field = FromModel._meta.get_field("picture")
111-
assert migration.update_pictures.called_once_with(from_field, ToModel)
111+
migration.update_pictures.assert_called_once_with(from_field, ToModel)
112112
assert not migration.from_picture_field.called
113113
assert not migration.to_picture_field.called
114114

0 commit comments

Comments
 (0)