forked from frlp-utn-ingsoft/vetsoft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Agrego el test unitario para validar que el campo telefono sea numerico
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -274,6 +274,21 @@ def test_phone_number_without_54(self): | |
self.assertIn("phone", errors) | ||
self.assertEqual(errors["phone"], "El telefono debe comenzar con 54") | ||
|
||
def test_phone_number_with_a_letter(self): | ||
""" | ||
La funcion verifica que el campo solo tengo caracteres numericos | ||
""" | ||
client_data = { | ||
"name": "Juan Sebastian Veron", | ||
"phone": "a2245556789", | ||
"city": "La Plata", | ||
"email": "[email protected]", | ||
} | ||
errors = validate_client(client_data) | ||
self.assertIn("phone", errors) | ||
self.assertEqual(errors["phone"], "El teléfono solo debe contener números") | ||
|
||
class MedicineModelTest(TestCase): | ||
""" | ||
Pruebas para el modelo Medicina. | ||
|