'A command called from the command line should close connections after
being executed (#21255).'

def test_run_from_argv_closes_connections(self):

    command = BaseCommand(stderr=StringIO())
    command.check = (lambda : [])
    command.handle = (lambda *args, **kwargs: args)
    with mock.patch('django.core.management.base.connections') as mock_connections:
        command.run_from_argv(['', ''])
    self.assertTrue(mock_connections.close_all.called)
