Ejemplo n.º 1
0
 def test_list_with_model(self):
     model = Mock(spec=Model)
     model.pk = "321"
     self.assertEqual(
         format_val_for_js([1, "2", model]),
         ["1", "2", "321"],
     )
Ejemplo n.º 2
0
 def test_simple_list(self):
     self.assertEqual(
         format_val_for_js([True, "456", None, 123]),
         [True, "456", None, "123"],
     )
Ejemplo n.º 3
0
 def test_list_with_date(self):
     dt = date(2012, 04, 15)
     self.assertEqual(
         format_val_for_js([True, "456", dt, 123]),
         [True, "456", "2012-04-15", "123"],
     )
Ejemplo n.º 4
0
 def test_single_string(self):
     self.assertEqual(format_val_for_js("abcdefgh22"), "abcdefgh22")
     self.assertEqual(format_val_for_js("Pokoijiuh"), "Pokoijiuh")