diff --git a/tienda_ilusion/don_confiao/tests/Fixtures/sales_fixture.json b/tienda_ilusion/don_confiao/tests/Fixtures/sales_fixture.json new file mode 100644 index 0000000..e51b994 --- /dev/null +++ b/tienda_ilusion/don_confiao/tests/Fixtures/sales_fixture.json @@ -0,0 +1,36 @@ +[ + { + "model": "don_confiao.customer", + "pk": 1, + "fields": { + "name": "Alejandro Fernandez", + "address": "Avenida Siempre Viva" + } + }, + { + "model": "don_confiao.productcategory", + "pk": 1, + "fields": { + "name": "Unidad", + } + }, + { + "model": "don_confiao.product", + "pk": 1, + "fields": { + "name": "Papaya", + "price": 2500, + "measuring_unit": "Unidad", + } + }, + { + "model": "don_confiao.sale", + "pk": 1, + "fields": { + "customer": 1, + "date": "2024-08-31", + "phone": 312201103, + "description": "Primera Venta" + } + } +] diff --git a/tienda_ilusion/don_confiao/tests/test_export_sales.py b/tienda_ilusion/don_confiao/tests/test_export_sales.py new file mode 100644 index 0000000..450b23b --- /dev/null +++ b/tienda_ilusion/don_confiao/tests/test_export_sales.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +from django.test import TestCase +from ..models import Sale + + +class TestExportSales(TestCase): + + def setUp(self): + pass + + def test_export_sales(self): + sales = self._export_sales_csv() + self.assertEqual(len(sales), 1) + + def _export_sales_csv(self): + raise Exception(Sale.objects.all())