Пример #1
0
 def test_osm_field_with_args(self):
     field = OSMField(lat_field="some_lat_field", lon_field="some_lon_field")
     field.set_attributes_from_name("location")
     name, path, args, kwargs = field.deconstruct()
     self.assertEqual(name, "location")
     self.assertEqual(path, "osm_field.fields.OSMField")
     self.assertEqual(args, [])
     self.assertEqual(
         kwargs, {"lat_field": "some_lat_field", "lon_field": "some_lon_field"}
     )
Пример #2
0
 def test_osm_field_with_args(self):
     field = OSMField(lat_field='some_lat_field', lon_field='some_lon_field')
     field.set_attributes_from_name("location")
     name, path, args, kwargs = field.deconstruct()
     self.assertEqual(name, 'location')
     self.assertEqual(path, 'osm_field.fields.OSMField')
     self.assertEqual(args, [])
     self.assertEqual(kwargs, {
         'lat_field': 'some_lat_field',
         'lon_field': 'some_lon_field',
     })
Пример #3
0
 def test_osm_field_with_args(self):
     field = OSMField(lat_field='some_lat_field', lon_field='some_lon_field')
     field.set_attributes_from_name("location")
     name, path, args, kwargs = field.deconstruct()
     self.assertEqual(name, 'location')
     self.assertEqual(path, 'osm_field.fields.OSMField')
     self.assertEqual(args, [])
     self.assertEqual(kwargs, {
         'lat_field': 'some_lat_field',
         'lon_field': 'some_lon_field',
     })