Esempio n. 1
0
 def test_longitude_float(self):
     """Comprueba que la longitud sea un número flotante."""
     venue = Venue(name="Lugar 1",
                   address="Calle abc",
                   latitude=1.123,
                   longitude="Cadena")
     with self.assertRaisesRegex(ValidationError, "(longitude)"):
         venue.full_clean()
Esempio n. 2
0
 def test_website_url(self):
     """Comprueba que el website sea una URL."""
     venue = Venue(name="Lugar 1",
                   address="Calle abc",
                   website="No es una URL",
                   latitude=1.123,
                   longitude=1.123)
     with self.assertRaisesRegex(ValidationError, "(website).*(URL)"):
         venue.full_clean()
Esempio n. 3
0
 def test_phone_length(self):
     """Comprueba la longitud del teléfono."""
     venue = Venue(name="Lugar 1",
                   address="Calle abc",
                   phone="Lorem ipsum dolor si",
                   latitude=1.123,
                   longitude=1.123)
     with self.assertRaisesRegex(ValidationError, "(phone).*(18)"):
         venue.full_clean()
Esempio n. 4
0
 def test_state_length(self):
     """Prueba la longitud del departamento."""
     venue = Venue(name="Lugar 1",
                   address="Calle abc",
                   state="Lorem ipsum dolor sit amet, consect",
                   latitude=1.123,
                   longitude=1.123)
     with self.assertRaisesRegex(ValidationError, "(state).*(32)"):
         venue.full_clean()
Esempio n. 5
0
 def test_city_length(self):
     """Prueba la longitud de la ciudad."""
     venue = Venue(name="Lugar 1",
                   address="Calle abc",
                   city="Lorem ipsum dolor sit amet, consect",
                   latitude=1.123,
                   longitude=1.123)
     with self.assertRaisesRegex(ValidationError, "(city).*(32)"):
         venue.full_clean()
Esempio n. 6
0
 def test_address_length(self):
     """Prueba la longitud de la dirección."""
     venue = Venue(
         name="Lugar 1",
         address="Lorem ipsum dolor sit amet, consectetuer adipiscing "\
             "elit Aenean commo",
         latitude=1.123,
         longitude=1.123
     )
     with self.assertRaisesRegex(ValidationError, "(address).*(64)"):
         venue.full_clean()
Esempio n. 7
0
 def test_name_length(self):
     """Prueba de longitud del nombre."""
     venue = Venue(
         name="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. "\
             "Aenean commodo ligula eget dolor aenean",
         address="Calle abc",
         latitude=1.123,
         longitude=1.123
     )
     with self.assertRaisesRegex(ValidationError, "(name).*(96)"):
         venue.full_clean()