def test_no_html_in_csv_signage(self):
     if settings.TREKKING_TOPOLOGY_ENABLED:
         SignageInterventionFactory.create()
     else:
         SignageInterventionFactory.create(
             geom='SRID=2154;POINT (700000 6600000)')
     super(InterventionViewsTest, self).test_no_html_in_csv()
 def test_update_signage(self):
     self.login()
     target_year = 2017
     if settings.TREKKING_TOPOLOGY_ENABLED:
         intervention = SignageInterventionFactory.create()
     else:
         intervention = SignageInterventionFactory.create(
             geom='SRID=2154;POINT (700000 6600000)')
     signa = intervention.signage
     # Save infrastructure form
     response = self.client.get(signa.get_update_url())
     form = response.context['form']
     data = form.initial
     data['name'] = 'modified'
     data['implantation_year'] = target_year
     if settings.TREKKING_TOPOLOGY_ENABLED:
         data['topology'] = '{"paths": [%s]}' % PathFactory.create().pk
     else:
         data['geom'] = 'SRID=4326;POINT (2.0 6.6)'
     data['manager'] = OrganismFactory.create().pk
     response = self.client.post(signa.get_update_url(), data)
     self.assertEqual(response.status_code, 302)
     # Check that intervention was not deleted (bug #783)
     intervention.reload()
     self.assertFalse(intervention.deleted)
     self.assertEqual(intervention.signage.name, 'modified')
     self.assertEqual(intervention.signage.implantation_year, target_year)
    def test_infrastructure_display_shows_infrastructure_name(self):
        interv = InfrastructureInterventionFactory.create()
        self.assertIn('Infrastructure', interv.infrastructure_display)
        self.assertIn('infrastructure-16.png', interv.infrastructure_display)
        name = interv.infrastructure.name
        self.assertIn(name, interv.infrastructure_display)

        interv = SignageInterventionFactory.create()
        self.assertIn('Signage', interv.infrastructure_display)
        self.assertIn('signage-16.png', interv.infrastructure_display)
        name = interv.signage.name
        self.assertIn(name, interv.infrastructure_display)
Esempio n. 4
0
    def test_infrastructure_display_shows_infrastructure_name(self):
        interv = InfrastructureInterventionFactory.create()
        self.assertIn('Infrastructure', interv.infrastructure_display)
        self.assertIn('infrastructure-16.png', interv.infrastructure_display)
        name = interv.infrastructure.name
        self.assertIn(name, interv.infrastructure_display)

        interv = SignageInterventionFactory.create()
        self.assertIn('Signage', interv.infrastructure_display)
        self.assertIn('signage-16.png', interv.infrastructure_display)
        name = interv.infrastructure.name
        self.assertIn(name, interv.infrastructure_display)
Esempio n. 5
0
 def test_update_signage(self):
     self.login()
     target_year = 2017
     intervention = SignageInterventionFactory.create()
     signa = intervention.signage
     # Save infrastructure form
     response = self.client.get(signa.get_update_url())
     form = response.context['form']
     data = form.initial
     data['name'] = 'modified'
     data['implantation_year'] = target_year
     data['topology'] = '{"paths": [%s]}' % PathFactory.create().pk
     data['manager'] = OrganismFactory.create().pk
     response = self.client.post(signa.get_update_url(), data)
     self.assertEqual(response.status_code, 302)
     # Check that intervention was not deleted (bug #783)
     intervention.reload()
     self.assertFalse(intervention.deleted)
     self.assertEqual(intervention.signage.name, 'modified')
     self.assertEqual(intervention.signage.implantation_year, target_year)
Esempio n. 6
0
 def test_update_signage(self):
     self.login()
     target_year = 2017
     intervention = SignageInterventionFactory.create()
     signa = intervention.signage
     # Save infrastructure form
     response = self.client.get(signa.get_update_url())
     form = response.context['form']
     data = form.initial
     data['name'] = 'modified'
     data['implantation_year'] = target_year
     data['topology'] = '{"paths": [%s]}' % PathFactory.create().pk
     data['manager'] = OrganismFactory.create().pk
     response = self.client.post(signa.get_update_url(), data)
     self.assertEqual(response.status_code, 302)
     # Check that intervention was not deleted (bug #783)
     intervention.reload()
     self.assertFalse(intervention.deleted)
     self.assertEqual(intervention.signage.name, 'modified')
     self.assertEqual(intervention.signage.implantation_year, target_year)
Esempio n. 7
0
 def test_no_html_in_csv_signage(self):
     SignageInterventionFactory.create()
     super(InterventionViewsTest, self).test_no_html_in_csv()
Esempio n. 8
0
 def test_no_html_in_csv_signage(self):
     SignageInterventionFactory.create()
     super(InterventionViewsTest, self).test_no_html_in_csv()