Пример #1
0
 def test_valid_URL_spaces(self):
     primerT = Tech.objects.create(title=" primer  tecnicismo ",
                                   summary="Hola",
                                   content="Adios")
     save_model(primerT, "/tecnicismo/")
     
     self.assertEqual(primerT.url, settings.LOCALHOST + "/tecnicismo/primer-tecnicismo")
Пример #2
0
 def test_valid_URL_accents(self):
     primerA = Article.objects.create(title="Primér ártícúló",
                                      summary="Hola",
                                      content="Adios")
     save_model(primerA, "/articulo/")
     
     self.assertEqual(primerA.url, settings.LOCALHOST + "/articulo/primer-articulo")
Пример #3
0
 def test_valid_URL_reset(self):
     primerA = Article.objects.create(title="primer-articulo",
                                      summary="Hola",
                                      content="Adios",
                                      url=settings.LOCALHOST + "/articulo/porque-si")
     save_model(primerA, "/articulo/")
     
     self.assertEqual(primerA.url, settings.LOCALHOST + "/articulo/porque-si")
     
     primerA.url = "burrada"
     save_model(primerA, "/articulo/")
     
     self.assertEqual(primerA.url, settings.LOCALHOST + "/articulo/primer-articulo")
Пример #4
0
 def save_model(self, request, model, form, changed):
     save_model(model, "/informe/")
Пример #5
0
 def save_model(self, request, model, form, changed):
     save_model(model, "/informe/")
Пример #6
0
 def test_valid_URL_slash(self):
     primerI = Report.objects.create(title="/Primer informe/",
                                     summary="Hola")
     save_model(primerI, "/informe/")
     
     self.assertEqual(primerI.url, settings.LOCALHOST + "/informe/primer-informe")