mirror of
https://github.com/ae-utbm/sith.git
synced 2025-10-09 08:14:39 +00:00
adding test
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
</td>
|
||||
<td>{{ purchase.counter }}</td>
|
||||
{% if not purchase.seller %}
|
||||
<td>{% trans %}Deleted User{% endtrans %}</td>
|
||||
<td>{% trans %}Deleted user{% endtrans %}</td>
|
||||
{% else %}
|
||||
<td><a href="{{ purchase.seller.get_absolute_url() }}">{{ purchase.seller.get_display_name() }}</a></td>
|
||||
{% endif %}
|
||||
|
@@ -20,7 +20,8 @@ from core.baker_recipes import (
|
||||
)
|
||||
from core.models import Group, User
|
||||
from core.views import UserTabsMixin
|
||||
from counter.models import Counter, Refilling, Selling
|
||||
from counter.baker_recipes import sale_recipe
|
||||
from counter.models import Counter, Customer, Refilling, Selling
|
||||
from eboutic.models import Invoice, InvoiceItem
|
||||
|
||||
|
||||
@@ -129,6 +130,31 @@ def test_user_account_not_found(client: Client):
|
||||
assert res.status_code == 404
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_is_deleted_barman_shown_as_deleted(client: Client):
|
||||
customer = baker.make(Customer)
|
||||
date = now()
|
||||
sale_recipe.make(
|
||||
seller=iter([None, baker.make(User)]),
|
||||
customer=customer,
|
||||
date=date,
|
||||
_quantity=2,
|
||||
_bulk_create=True,
|
||||
)
|
||||
client.force_login(customer.user)
|
||||
res = client.get(
|
||||
reverse(
|
||||
"core:user_account_detail",
|
||||
kwargs={
|
||||
"user_id": customer.user.id,
|
||||
"year": date.year,
|
||||
"month": date.month,
|
||||
},
|
||||
)
|
||||
)
|
||||
assert res.status_code == 200
|
||||
|
||||
|
||||
class TestFilterInactive(TestCase):
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
|
Reference in New Issue
Block a user