Exemplo n.º 1
0
 def test_same_layer_clean_different_crud_view(self):
     RoutingSettingsFactory.create(provider="geostore",
                                   layer=self.layer,
                                   crud_view=self.crud_view)
     setting = RoutingSettingsFactory.build(provider="geostore",
                                            layer=self.layer,
                                            crud_view=self.other_crud_view,
                                            label="Other")
     setting.clean()
     self.assertEqual(str(setting), 'Other')
Exemplo n.º 2
0
 def test_same_layer_clean(self):
     RoutingSettingsFactory.create(provider="geostore",
                                   layer=self.layer,
                                   crud_view=self.crud_view)
     setting = RoutingSettingsFactory.build(provider="geostore",
                                            layer=self.layer,
                                            crud_view=self.crud_view)
     with self.assertRaisesRegex(ValidationError,
                                 'This layer is already used'):
         setting.clean()
Exemplo n.º 3
0
 def test_same_transit_clean_different_crud_view(self):
     RoutingSettingsFactory.create(provider="mapbox",
                                   mapbox_transit='cycling',
                                   crud_view=self.crud_view)
     setting = RoutingSettingsFactory.build(provider="mapbox",
                                            mapbox_transit='cycling',
                                            crud_view=self.other_crud_view,
                                            label="Other")
     setting.clean()
     self.assertEqual(str(setting), 'Other')
Exemplo n.º 4
0
 def test_same_transit_clean(self):
     RoutingSettingsFactory.create(provider="mapbox",
                                   mapbox_transit='cycling',
                                   crud_view=self.crud_view)
     setting = RoutingSettingsFactory.build(provider="mapbox",
                                            mapbox_transit='cycling',
                                            crud_view=self.crud_view)
     with self.assertRaisesRegex(ValidationError,
                                 'This transit is already used'):
         setting.clean()