arrobalytics / django-ledger

Django Ledger is a double entry accounting system built on the Django Web Framework.
https://www.djangoledger.com
GNU General Public License v3.0
922 stars 215 forks source link

test failure : FAIL: test_bill_detail (django_ledger.tests.test_bill.BillModelTests.test_bill_detail) #221

Open tolland opened 1 month ago

tolland commented 1 month ago

Describe the bug Run the tests from the develop branch some are failing, this one on a template issue:

$ python manage.py test django_ledger.tests.test_bill.BillModelTests.test_bill_detail
Found 1 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
08/03/2024 01:19:00 AM Populating Entity Testing Inc-626038...
F
======================================================================
FAIL: test_bill_detail (django_ledger.tests.test_bill.BillModelTests.test_bill_detail)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user1/git/django-ledger/django_ledger/tests/test_bill.py", line 370, in test_bill_detail
    self.assertContains(bill_detail_response, 'id="djl-bill-detail-amount-owed"')
  File "/home/user1/.local/share/virtualenvs/django-ledger-azuD17Ir/lib/python3.11/site-packages/django/test/testcases.py", line 537, in assertContains
    self.assertTrue(
AssertionError: False is not true : Couldn't find 'id="djl-bill-detail-amount-owed"' in response

----------------------------------------------------------------------
Ran 1 test in 11.594s

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

tolland commented 1 month ago

It's happening because the string its looking for is in the conditional block that requires the bill model to be accrue == True https://github.com/arrobalytics/django-ledger/blob/develop/django_ledger/templates/django_ledger/bills/bill_detail.html#L68-L76

tolland commented 1 month ago

https://github.com/arrobalytics/django-ledger/pull/222/files