예제 #1
0
 def test_list_field_to_python_dict(self):
     ret = ListField()
     input_value = {'name': 'bar'}
     output = ret.to_python(value=input_value)
     self.assertListEqual([], output)
예제 #2
0
 def test_list_field_to_python_str(self, mock_jl):
     ret = ListField()
     ret.to_python(value='foo')
     mock_jl.assert_called_with('foo')
예제 #3
0
 def test_list_field_to_python_list(self):
     ret = ListField()
     input_value = ['foo', 'bar']
     output = ret.to_python(value=input_value)
     self.assertListEqual(input_value, output)
예제 #4
0
 def test_list_field_to_python_none(self):
     ret = ListField()
     self.assertIsNone(ret.to_python(value=None))
예제 #5
0
 def test_list_field_to_python_empty_str(self):
     ret = ListField()
     self.assertListEqual([], ret.to_python(value=""))
예제 #6
0
 def test_list_field_to_python_dict(self):
     ret = ListField()
     input_value = {'name': 'bar'}
     output = ret.to_python(value=input_value)
     self.assertListEqual([], output)
예제 #7
0
 def test_list_field_to_python_list(self):
     ret = ListField()
     input_value = ['foo', 'bar']
     output = ret.to_python(value=input_value)
     self.assertListEqual(input_value, output)
예제 #8
0
 def test_list_field_to_python_str(self, mock_jl):
     ret = ListField()
     ret.to_python(value='foo')
     mock_jl.assert_called_with('foo')
예제 #9
0
 def test_list_field_to_python_empty_str(self):
     ret = ListField()
     self.assertListEqual([], ret.to_python(value=""))
예제 #10
0
 def test_list_field_to_python_none(self):
     ret = ListField()
     self.assertIsNone(ret.to_python(value=None))