\n\n\n\n0 | \n | \n
\n\n\n1 | \n | \n
\n\n\n2 | \n | \n
\n\n\n\n'
+ )
+
+ def test_format_value_simple_string(self):
+ """
+ Tests format_value with a simple string
+ """
+ simple_string = 'this is an example of a string'
+ self.assertEqual(format_value(simple_string), simple_string)
+
+ def test_format_value_string_hyperlink(self):
+ """
+ Tests format_value with a url
+ """
+ url = 'http://www.example.com'
+ self.assertEqual(format_value(url), 'http://www.example.com')
+
+ def test_format_value_string_email(self):
+ """
+ Tests format_value with an email address
+ """
+ email = 'something@somewhere.com'
+ self.assertEqual(format_value(email), 'something@somewhere.com')
+
+ def test_format_value_string_newlines(self):
+ """
+ Tests format_value with a string with newline characters
+ :return:
+ """
+ text = 'Dear user, \n this is a message \n from,\nsomeone'
+ self.assertEqual(format_value(text), 'Dear user, \n this is a message \n from,\nsomeone
')
+
+ def test_format_value_object(self):
+ """
+ Tests that format_value with a object returns the object's __str__ method
+ """
+ obj = object()
+ self.assertEqual(format_value(obj), obj.__str__())
+
+ def test_add_nested_class(self):
+ """
+ Tests that add_nested_class returns the proper class
+ """
+ positive_cases = [
+ [['item']],
+ [{'item1': 'value1'}],
+ {'item1': 'value1'}
+ ]
+
+ negative_cases = [
+ ['list'],
+ '',
+ None,
+ True,
+ False
+ ]
+
+ for case in positive_cases:
+ self.assertEqual(add_nested_class(case), 'class=nested')
+
+ for case in negative_cases:
+ self.assertEqual(add_nested_class(case), '')
+
class Issue1386Tests(TestCase):
"""