No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_text.py 752B

123456789101112131415161718192021222324252627
  1. import unittest
  2. from lodel.leapi.datahandlers.datas import Text
  3. from lodel.exceptions import FieldValidationError
  4. class TextTestCase(unittest.TestCase):
  5. def test_base_type_property_value_equals_text(self):
  6. self.assertEqual(Text.base_type, 'text')
  7. def test_non_string_value_throws_FieldValidationError(self):
  8. self.assertRaises(
  9. FieldValidationError,
  10. Text()._check_data_value,
  11. bool
  12. )
  13. def test_check_data_returns_unchanged_strnig_parameter_if_valid(self):
  14. test_value = """ Ceci est un texte multiligne pour tester le check
  15. sur le datahandler
  16. Text
  17. """
  18. self.assertEqual(Text()._check_data_value(test_value), test_value)