Feat: Se añade modelo Sale
This commit is contained in:
parent
4b9983b0db
commit
03b2395074
@ -1,3 +1,9 @@
|
|||||||
from django.db import models
|
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)
|
||||||
|
@ -1,7 +1,18 @@
|
|||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
from .models import Sale
|
||||||
|
|
||||||
|
|
||||||
class ConfiaoTest(TestCase):
|
class ConfiaoTest(TestCase):
|
||||||
|
|
||||||
def test_bobo(self):
|
def test_bobo(self):
|
||||||
self.assertTrue(True)
|
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)
|
||||||
|
@ -31,12 +31,14 @@ ALLOWED_HOSTS = []
|
|||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
INSTALLED_APPS = [
|
||||||
|
'don_confiao.apps.DonConfiaoConfig',
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
'django.contrib.contenttypes',
|
'django.contrib.contenttypes',
|
||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
# 'don_confiao'
|
||||||
]
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
|
Loading…
Reference in New Issue
Block a user