OpenSlides/tests/utils/test_utils.py
2013-10-13 20:43:26 +02:00

26 lines
789 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests for openslides utils.utils
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TODO: Move this test to the correct place when the projector app is cleaned up.
:copyright: 20112013 by OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
from openslides.utils.test import TestCase
from openslides.utils.utils import html_strong, int_or_none
class Test_functions(TestCase):
def test_string(self):
self.assertEqual(html_strong('some text'), '<strong>some text</strong>')
def test_int_or_none(self):
self.assertEqual(int_or_none('5'), 5)
self.assertEqual(int_or_none(5), 5)
self.assertIsNone(int_or_none('text'))
self.assertIsNone(int_or_none(None))