コード例 #1
0
 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))
コード例 #2
0
 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))
コード例 #3
0
 def test_from_db_value_empty(self):
     f = JSignatureField()
     for val in ['', [], '[]']:
         self.assertIsNone(f.from_db_value(val))