Test pay with sith

This commit is contained in:
2025-04-23 00:11:50 +02:00
parent 8af6af1303
commit 2a7c1a6438
7 changed files with 163 additions and 43 deletions

View File

@ -1,3 +1,4 @@
import pytest
from django.http import HttpResponse
from django.test import TestCase
from django.test.client import Client
@ -9,11 +10,20 @@ from pytest_django.asserts import assertRedirects
from core.baker_recipes import subscriber_user
from core.models import Group, User
from counter.baker_recipes import product_recipe
from counter.models import Counter, ProductType
from counter.models import Counter, ProductType, get_eboutic
from counter.tests.test_counter import BasketItem
from eboutic.models import Basket
@pytest.mark.django_db
def test_get_eboutic():
assert Counter.objects.get(name="Eboutic") == get_eboutic()
baker.make(Counter, type="EBOUTIC")
assert Counter.objects.get(name="Eboutic") == get_eboutic()
class TestEboutic(TestCase):
@classmethod
def setUpTestData(cls):
@ -51,7 +61,7 @@ class TestEboutic(TestCase):
cls.new_customer.groups.add(cls.group_public)
cls.new_customer_adult.groups.add(cls.group_public)
cls.eboutic = Counter.objects.get(name="Eboutic")
cls.eboutic = get_eboutic()
cls.eboutic.products.add(cls.cotiz, cls.beer, cls.snack)
@classmethod