def test_prep_value_correct_values_json(self): w = JSignatureWidget() val = [{"x": [1, 2], "y": [3, 4]}] val_str = '[{"x":[1,2], "y":[3,4]}]' val_prep = w.prep_value(val_str) self.assertIsInstance(val_prep, six.string_types) self.assertEquals(val, json.loads(val_prep))
def test_prep_value_empty_values(self): w = JSignatureWidget() for val in ['', [], '[]']: self.assertEqual('[]', w.prep_value(val))