OpenSlides/tests/old/projector/test_overlays.py
Oskar Hahn e7230b7391 New Test order.
* seperate unittests and integration tests
* moved old tests in seperat folder 'old'
* created a testrunner that does not create a testdatabase, if only unittests are run
* wrote some unit- and integration tests as examples
* fixed user.get_short_name() to use the sort order from config
* fixed wrong url_pattern in the user app
2015-01-24 18:00:03 +01:00

20 lines
689 B
Python

import warnings
from unittest.mock import MagicMock
from openslides.projector.projector import Overlay
from openslides.utils.test import TestCase
class OverlayTest(TestCase):
def test_error_in_html(self):
"""
Tests that the method get_projector_html does not raise any errors.
"""
get_projector_html = MagicMock(side_effect=Exception('no good error'))
overlay = Overlay('test_overlay', lambda: 'widget_html', get_projector_html)
with warnings.catch_warnings(record=True) as warning:
overlay.get_projector_html()
self.assertEqual(str(warning[0].message), 'Exception in overlay "test_overlay": no good error')