Feat: Se añade modelo Sale

This commit is contained in:
Rodia 2024-06-22 10:38:03 -05:00
parent 4b9983b0db
commit 03b2395074
3 changed files with 20 additions and 1 deletions

View File

@ -1,3 +1,9 @@
from django.db import models
# Create your models here.
class Sale(models.Model):
customer = models.CharField(max_length=100)
date = models.DateField("Date")
phone = models.CharField(max_length=13)
description = models.CharField(max_length=255)

View File

@ -1,7 +1,18 @@
from django.test import TestCase
from .models import Sale
class ConfiaoTest(TestCase):
def test_bobo(self):
self.assertTrue(True)
def test_create_sale(self):
sale = Sale()
sale.customer = "Alejandro"
sale.date = "2024-06-22"
sale.phone = '666666666'
sale.description = "Description"
sale.save()
self.assertIsInstance(sale, Sale)

View File

@ -31,12 +31,14 @@ ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'don_confiao.apps.DonConfiaoConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# 'don_confiao'
]
MIDDLEWARE = [