2013-11-24 17:19:14 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2014-01-10 18:47:21 +01:00
|
|
|
import warnings
|
|
|
|
|
|
|
|
from mock import MagicMock
|
2013-11-24 17:19:14 +01:00
|
|
|
|
|
|
|
from openslides.projector.projector import Overlay
|
|
|
|
from openslides.utils.test import TestCase
|
|
|
|
|
|
|
|
|
|
|
|
class OverlayTest(TestCase):
|
|
|
|
def test_error_in_html(self):
|
|
|
|
"""
|
2014-01-10 18:47:21 +01:00
|
|
|
Tests that the method get_projector_html does not raise any errors.
|
2013-11-24 17:19:14 +01:00
|
|
|
"""
|
|
|
|
get_projector_html = MagicMock(side_effect=Exception('no good error'))
|
|
|
|
overlay = Overlay('test_overlay', lambda: 'widget_html', get_projector_html)
|
|
|
|
|
2014-01-10 18:47:21 +01:00
|
|
|
with warnings.catch_warnings(record=True) as warning:
|
|
|
|
overlay.get_projector_html()
|
|
|
|
self.assertEqual(warning[0].message.message, 'Exception in overlay "test_overlay": no good error')
|