2015-01-22 18:29:12 +01:00
|
|
|
from unittest import TestCase
|
|
|
|
|
2013-09-25 12:53:44 +02:00
|
|
|
from openslides.utils.utils import html_strong, int_or_none
|
|
|
|
|
|
|
|
|
|
|
|
class Test_functions(TestCase):
|
2015-01-22 18:29:12 +01:00
|
|
|
def test_html_strong(self):
|
2013-09-25 12:53:44 +02:00
|
|
|
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))
|