def test_get_prep_value_correct_values_json(self): f = JSignatureField() val = [{"x": [1, 2], "y": [3, 4]}] val_str = '[{"x":[1,2], "y":[3,4]}]' val_prep = f.get_prep_value(val_str) self.assertIsInstance(val_prep, six.string_types) self.assertEquals(val, json.loads(val_prep))
def test_get_prep_value_empty(self): f = JSignatureField() for val in ['', [], '[]']: self.assertIsNone(f.get_prep_value(val))