Example #1
0
 def test_invalidate_incident(self):
     """Check that an incident when tagged as incorrect will properly be un-validated."""
     i1 = Incident(line=Line.objects.get(pk=1), reason="Probleme dans le RER B", source="Android app", level=4)
     i1.save()
     response = self.client.post(reverse("api_vote_url", args=["json", i1.id, "minus"]), "", content_type="")
     self.assertEqual(response.status_code, 201)
     self.assertFalse(Incident.objects.get(pk=i1.id).validated)   
Example #2
0
 def test_get_incident(self):            
     # init incident :
     i1 = Incident(line=Line.objects.get(pk=1), reason="Probleme dans le RER B", source="Android app", level=4)
     i1.save()    
     
     c = Client()
     respo = c.get("/api/incident.json/%s" % (i1.pk))
     self.assertEqual(respo.status_code, 200)