def test_to_string_when_no_json(self): option = ListOption(parse_json=False) result = option.to_string(['1', '2', '3']) self.assertEqual(result, "['1', '2', '3']")
def test_to_string_when_json(self): option = ListOption() result = option.to_string(['1', '2', '3']) self.assertEqual(result, '["1", "2", "3"]') self.assertNotEqual(result, "['1', '2', '3']")
def test_to_string_when_no_json(self): option = ListOption(parse_json=False) result = option.to_string(['1', '2', '3']) expected = [text_type(x) for x in [1, 2, 3]] self.assertEqual(result, text_type(expected))