@patch('salt.modules.mac_desktop.get_output_volume',
           MagicMock(return_value='25'))
    def test_set_output_volume(self):
        mock = MagicMock(return_value={'retcode': 0})
        with patch.dict(mac_desktop.__salt__, {'cmd.run_all': mock}):
            self.assertTrue(mac_desktop.set_output_volume('25'))
Checks to make sure the user is logged in & has a Django session.
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/mac_desktop_test.py/MacDesktopTestCase.test_set_output_volume--crossover with--dataset/ETHPy150Open django-tastypie/django-tastypie/tastypie/authentication.py/SessionAuthentication.is_authenticated