Skip to content

Commit

Permalink
Agrego el test unitario para validar el telefono del cliente.
Browse files Browse the repository at this point in the history
  • Loading branch information
CandelAbregu committed Jun 25, 2024
1 parent 9e222df commit e8e5827
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/tests_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,16 @@ def test_invalid_email_not_ending_with_com(self):

self.assertIn("El email debe tener un formato válido y ser de la forma [email protected]", errors.values())

def test_phone_number_without_54(self):
client_data = {
"name": "Juan Sebastian Veron",
"phone": "2245556789",
"city": "La Plata",
"email": "[email protected]",
}
errors = validate_client(client_data)
self.assertIn("phone", errors)
self.assertEqual(errors["phone"], "El telefono debe comenzar con 54")

class MedicineModelTest(TestCase):
"""
Expand Down

0 comments on commit e8e5827

Please sign in to comment.