Skip to content

Commit

Permalink
feat: Corrijo los errores de la nueva regla
Browse files Browse the repository at this point in the history
  • Loading branch information
nuriarobledo committed Jun 4, 2024
1 parent e7431c5 commit 1f2a2f0
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
10 changes: 7 additions & 3 deletions app/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
from django.db import models
from django.core.exceptions import ValidationError
#Importaciones de Python
import re
from datetime import date

import re
#Importaciones de Django
from django.core.exceptions import ValidationError
from django.db import models


##---------clients----------
def validate_client(data):
errors = {}
Expand Down
6 changes: 4 additions & 2 deletions app/tests_integration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from django.test import TestCase
from django.shortcuts import reverse
from app.models import Client, Provider, Pet
from django.test import TestCase

from app.models import Client, Pet, Provider


class HomePageTest(TestCase):
def test_use_home_template(self):
Expand Down
7 changes: 4 additions & 3 deletions app/tests_unit.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from django.test import TestCase
from app.models import Client, Provider, validate_pet, validate_product,validate_medicine
from datetime import date

from django.test import TestCase

from app.models import Client, Provider, validate_medicine, validate_pet, validate_product

class ClientModelTest(TestCase):
def test_can_create_and_get_client(self):
Client.save_client(
Expand Down Expand Up @@ -58,7 +60,6 @@ def test_update_client_with_error(self):

self.assertEqual(client_updated.phone, "221555232")


class ProviderModelTest(TestCase):

def test_create_provider_with_address(self):
Expand Down
3 changes: 2 additions & 1 deletion app/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.urls import path
from . import views

from app import views

urlpatterns = [
path("", view=views.home, name="home"),
Expand Down
5 changes: 3 additions & 2 deletions app/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from django.shortcuts import render, redirect, reverse, get_object_or_404
from .models import Client, Medicine, Pet, Product, Provider, Vet
from django.shortcuts import get_object_or_404, redirect, render, reverse

from app.models import Client, Medicine, Pet, Product, Provider, Vet


def home(request):
Expand Down
4 changes: 3 additions & 1 deletion functional_tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os

from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from playwright.sync_api import sync_playwright, expect, Browser
from django.urls import reverse
from playwright.sync_api import Browser, expect, sync_playwright

from app.models import Client, Pet, Provider

os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"
Expand Down
4 changes: 1 addition & 3 deletions vetsoft/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
https://docs.djangoproject.com/en/5.0/ref/settings/
"""

from pathlib import Path

import os
from pathlib import Path, os

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
Expand Down

0 comments on commit 1f2a2f0

Please sign in to comment.