Fix: Export Sale Line
This commit is contained in:
		
							
								
								
									
										36
									
								
								tienda_ilusion/don_confiao/tests/Fixtures/sales_fixture.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								tienda_ilusion/don_confiao/tests/Fixtures/sales_fixture.json
									
									
									
									
									
										Normal file
									
								
							@@ -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"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
							
								
								
									
										16
									
								
								tienda_ilusion/don_confiao/tests/test_export_sales.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								tienda_ilusion/don_confiao/tests/test_export_sales.py
									
									
									
									
									
										Normal file
									
								
							@@ -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())
 | 
			
		||||
		Reference in New Issue
	
	Block a user