def test_from_db_value_correct_value_python(self): f = JSignatureField() val = [{"x": [1, 2], "y": [3, 4]}] self.assertEquals(val, f.from_db_value(val))
def test_from_db_value_correct_value_json(self): f = JSignatureField() val = [{"x": [1, 2], "y": [3, 4]}] val_str = '[{"x":[1,2], "y":[3,4]}]' self.assertEquals(val, f.from_db_value(val_str))
def test_from_db_value_empty(self): f = JSignatureField() for val in ['', [], '[]']: self.assertIsNone(f.from_db_value(val))