Update scroll and sale in activate view.

Fixes #939
This commit is contained in:
Oskar Hahn 2013-11-06 17:39:12 +01:00
parent 983a373102
commit 01eb64c1d2
2 changed files with 6 additions and 2 deletions

View File

@ -88,6 +88,8 @@ class ActivateView(RedirectView):
set_active_slide(kwargs['callback'], kwargs=dict(request.GET.items()))
config['projector_scroll'] = config.get_default('projector_scroll')
config['projector_scale'] = config.get_default('projector_scale')
call_on_projector({'scroll': config['projector_scroll'],
'scale': config['projector_scale']})
class SelectWidgetsView(TemplateView):

View File

@ -41,9 +41,10 @@ class ProjectorViewTest(TestCase):
class ActivateViewTest(TestCase):
rf = RequestFactory()
@patch('openslides.projector.views.call_on_projector')
@patch('openslides.projector.views.config')
@patch('openslides.projector.views.set_active_slide')
def test_get(self, mock_set_active_slide, mock_config):
def test_get(self, mock_set_active_slide, mock_config, mock_call_on_projector):
view = views.ActivateView()
view.request = self.rf.get('/?some_key=some_value')
@ -54,6 +55,7 @@ class ActivateViewTest(TestCase):
mock_config.get_default.assert_has_calls([call('projector_scroll'),
call('projector_scale')])
self.assertEqual(mock_config.__setitem__.call_count, 2)
self.assertTrue(mock_call_on_projector.called)
class SelectWidgetsViewTest(TestCase):