Used subTest() in migrate_signals.tests.MigrateSignalTests.test_args().

This commit is contained in:
Simon Charette 2021-02-04 06:30:53 +01:00 committed by Mariusz Felisiak
parent 5d9b065d3f
commit 31bebc558b
1 changed files with 10 additions and 9 deletions

View File

@ -73,15 +73,16 @@ class MigrateSignalTests(TransactionTestCase):
)
for receiver in [pre_migrate_receiver, post_migrate_receiver]:
args = receiver.call_args
self.assertEqual(receiver.call_counter, 1)
self.assertEqual(set(args), set(SIGNAL_ARGS))
self.assertEqual(args['app_config'], APP_CONFIG)
self.assertEqual(args['verbosity'], MIGRATE_VERBOSITY)
self.assertEqual(args['interactive'], MIGRATE_INTERACTIVE)
self.assertEqual(args['using'], 'default')
self.assertEqual(args['plan'], [])
self.assertIsInstance(args['apps'], migrations.state.StateApps)
with self.subTest(receiver=receiver):
args = receiver.call_args
self.assertEqual(receiver.call_counter, 1)
self.assertEqual(set(args), set(SIGNAL_ARGS))
self.assertEqual(args['app_config'], APP_CONFIG)
self.assertEqual(args['verbosity'], MIGRATE_VERBOSITY)
self.assertEqual(args['interactive'], MIGRATE_INTERACTIVE)
self.assertEqual(args['using'], 'default')
self.assertEqual(args['plan'], [])
self.assertIsInstance(args['apps'], migrations.state.StateApps)
@override_settings(MIGRATION_MODULES={'migrate_signals': 'migrate_signals.custom_migrations'})
def test_migrations_only(self):