Example #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)
Example #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')
Example #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)
Example #4
0
 def test_list_field_to_python_none(self):
     ret = ListField()
     self.assertIsNone(ret.to_python(value=None))
Example #5
0
 def test_list_field_to_python_empty_str(self):
     ret = ListField()
     self.assertListEqual([], ret.to_python(value=""))
Example #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)
Example #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)
Example #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')
Example #9
0
 def test_list_field_to_python_empty_str(self):
     ret = ListField()
     self.assertListEqual([], ret.to_python(value=""))
Example #10
0
 def test_list_field_to_python_none(self):
     ret = ListField()
     self.assertIsNone(ret.to_python(value=None))