Skip to content

Commit

Permalink
Actualizo test unitario
Browse files Browse the repository at this point in the history
  • Loading branch information
CandelAbregu committed Jun 5, 2024
1 parent 87cab26 commit 4a6adaf
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions app/tests_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ def test_can_create_and_get_client(self):
Client.save_client(
{
"name": "Juan Sebastian Veron",
"phone": "221555232",
"phone": "54221555232",
"city": "La Plata",
"email": "[email protected]",
},
)
clients = Client.objects.all()
self.assertEqual(len(clients), 1)

self.assertEqual(clients[0].name, "Juan Sebastian Veron")
self.assertEqual(clients[0].phone, "221555232")
self.assertEqual(clients[0].phone, "54221555232")
self.assertEqual(clients[0].city, "La Plata")
self.assertEqual(clients[0].email, "[email protected]")

Expand Down Expand Up @@ -66,7 +65,7 @@ def test_update_client_with_error(self):
Client.save_client(
{
"name": "Juan Sebastian Veron",
"phone": "221555232",
"phone": "54221555232",
"city": "La Plata",
"email": "[email protected]",
},
Expand All @@ -78,8 +77,8 @@ def test_update_client_with_error(self):

client.update_client({
"name": "Juan Sebastian Veron",
"phone": "54221555",
"address": "13 y 44",
"phone": "221555",
"city": "La Plata",
"email": "brujita75hotmail.com"})

client_updated = Client.objects.get(pk=1)
Expand All @@ -94,7 +93,7 @@ def test_validate_client_incorrect_name(self):

data = {
"name": "Juan Sebastian Veron 11",
"phone": "221555232",
"phone": "54221555232",
"city": "La Plata",
"email": "[email protected]",
}
Expand Down Expand Up @@ -126,14 +125,14 @@ def test_update_client_with_email_null(self): #nuevo test verificando que no pue
Client.save_client(
{
"name": "Juan Sebastian Veron",
"phone": "221555232",
"phone": "54221555232",
"city": "La Plata",
"email": "[email protected]",
},
)
client = Client.objects.get(pk=1)

self.assertEqual(client.phone, "221555232")
self.assertEqual(client.phone, "54221555232")

client.update_client({"email": ""})

Expand All @@ -148,7 +147,7 @@ def test_update_client_with_empty_name(self):
Client.save_client(
{
"name": "Juan Sebastian Veron",
"phone": "221555232",
"phone": "54221555232",
"city": "La Plata",
"email": "[email protected]",
},
Expand All @@ -169,7 +168,7 @@ def test_update_client_with_incorrect_name(self):
Client.save_client(
{
"name": "Juan Sebastian Veron",
"phone": "221555232",
"phone": "54221555232",
"city": "La Plata",
"email": "[email protected]",
},
Expand All @@ -180,7 +179,7 @@ def test_update_client_with_incorrect_name(self):

client.update_client({
"name": "Juan Sebastian Veron 11",
"phone": "221555232",
"phone": "54221555232",
"city": "La Plata",
"email": "[email protected]",})
client_updated = Client.objects.get(pk=1)
Expand Down

0 comments on commit 4a6adaf

Please sign in to comment.