mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
write command test
This commit is contained in:
@ -7,12 +7,15 @@ from django.test import Client, TestCase
|
||||
from django.urls import reverse
|
||||
from django.utils.timezone import now
|
||||
from model_bakery import baker, seq
|
||||
from model_bakery.recipe import Recipe, related
|
||||
from model_bakery.recipe import Recipe
|
||||
|
||||
from core.baker_recipes import old_subscriber_user, subscriber_user
|
||||
from core.baker_recipes import (
|
||||
old_subscriber_user,
|
||||
subscriber_user,
|
||||
very_old_subscriber_user,
|
||||
)
|
||||
from core.models import User
|
||||
from counter.models import Counter, Refilling, Selling
|
||||
from subscription.models import Subscription
|
||||
|
||||
|
||||
class TestSearchUsers(TestCase):
|
||||
@ -121,9 +124,6 @@ class TestFilterInactive(TestCase):
|
||||
def setUpTestData(cls):
|
||||
time_active = now() - settings.SITH_ACCOUNT_INACTIVITY_DELTA + timedelta(days=1)
|
||||
time_inactive = time_active - timedelta(days=3)
|
||||
very_old_subscriber = old_subscriber_user.extend(
|
||||
subscriptions=related(Recipe(Subscription, subscription_end=time_inactive))
|
||||
)
|
||||
counter, seller = baker.make(Counter), baker.make(User)
|
||||
sale_recipe = Recipe(
|
||||
Selling,
|
||||
@ -137,7 +137,7 @@ class TestFilterInactive(TestCase):
|
||||
baker.make(User),
|
||||
subscriber_user.make(),
|
||||
old_subscriber_user.make(),
|
||||
*very_old_subscriber.make(_quantity=3),
|
||||
*very_old_subscriber_user.make(_quantity=3),
|
||||
]
|
||||
sale_recipe.make(customer=cls.users[3].customer, date=time_active)
|
||||
baker.make(
|
||||
|
Reference in New Issue
Block a user