C
iMerge branch 'main' of ssh://gitea.onecluster.org:6666/OneTeam/don_confiao into ExportTrytonSaleLine
This commit is contained in:
2024-09-07 08:10:57 -05:00
6 changed files with 80 additions and 17 deletions

View File

@@ -0,0 +1,22 @@
from django.test import Client, TestCase
from ..models import Product
class TestBuyForm(TestCase):
def setUp(self):
self.client = Client()
self.product = Product()
self.product.name = "Arroz"
self.product.price = 5000
self.product.save()
def test_buy_contains_products_list(self):
response = self.client.get('/don_confiao/comprar')
self.assertIn(
self.product.name,
response.context['list_products']
)
content = response.content.decode('utf-8')
self.assertIn('5000', content)
self.assertIn('Arroz', content)
self.assertIn(str(self.product.id), content)