'makemigrations --name generate a custom migration name.'

def test_makemigrations_with_custom_name(self):

    with self.temporary_migration_module() as migration_dir:
        def cmd(migration_count, migration_name, *args):
            call_command('makemigrations', 'migrations', '--verbosity', '0', '--name', migration_name, *args)
            migration_file = os.path.join(migration_dir, ('%s_%s.py' % (migration_count, migration_name)))
            self.assertTrue(os.path.exists(migration_file))
            with open(migration_file, 'r', encoding='utf-8') as fp:
                content = fp.read()
                content = content.replace('    ', '')
            return content
        migration_name_0001 = 'my_initial_migration'
        content = cmd('0001', migration_name_0001)
        self.assertIn('dependencies=[\n]', content)
        if hasattr(importlib, 'invalidate_caches'):
            importlib.invalidate_caches()
        migration_name_0002 = 'my_custom_migration'
        content = cmd('0002', migration_name_0002, '--empty')
        self.assertIn(("dependencies=[\n('migrations','0001_%s'),\n]" % migration_name_0001), content)
        self.assertIn('operations=[\n]', content)
