Skip to content

Commit 8478350

Browse files
committed
refactoring test
1 parent 48eae5f commit 8478350

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tests/apps/migrations/commands/test_forwards_backwards.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,17 @@ def test_backwards_unknown_migration(self, print_: MagicMock):
120120
)
121121
)
122122

123-
self.assertTrue(
124-
print_.mock_calls[0]
125-
.args[0]
126-
.startswith("Unrecognized migration name - must be one of ")
123+
self.assertEqual(
124+
len(
125+
[
126+
i
127+
for i in print_.mock_calls
128+
if i.args[0].startswith(
129+
"Unrecognized migration name - must be one of "
130+
)
131+
]
132+
),
133+
1,
127134
)
128135

129136
@patch("piccolo.apps.migrations.commands.backwards.print")

0 commit comments

Comments
 (0)