Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

couple of fixes for failing tests on develop #222

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

tolland
Copy link
Contributor

@tolland tolland commented Aug 3, 2024

FAIL: test_bill_detail (django_ledger.tests.test_bill.BillModelTests.test_bill_detail)

move check to inside the conditional to match the template for test_bill_detail

before:

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

after:

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:26:12 AM Populating Entity Testing Inc-665267...
.
----------------------------------------------------------------------
Ran 1 test in 9.889s

OK


FAIL: test_invalid_account (django_ledger.tests.test_transactions.TransactionModelFormTest.test_invalid_account)

Before:

$ python manage.py test django_ledger.tests.test_transactions.TransactionModelFormTest.test_invalid_account
Found 1 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
08/03/2024 03:05:50 AM Populating Entity Testing Inc-365338...
F
======================================================================
FAIL: test_invalid_account (django_ledger.tests.test_transactions.TransactionModelFormTest.test_invalid_account)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/user1/git/django-ledger/django_ledger/tests/test_transactions.py", line 71, in test_invalid_account
    with self.assertRaises(ObjectDoesNotExist):
AssertionError: ObjectDoesNotExist not raised

----------------------------------------------------------------------
Ran 1 test in 9.793s

FAILED (failures=1)

testing is failing because form validation never throws the exception mentioned.

After:

$ python manage.py test django_ledger.tests.test_transactions.TransactionModelFormTest.test_invalid_account
Found 1 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
08/03/2024 03:08:27 AM Populating Entity Testing Inc-737980...
.
----------------------------------------------------------------------
Ran 1 test in 10.763s

OK

@tolland tolland changed the base branch from master to develop August 3, 2024 05:28
@tolland tolland changed the title move check to inside the conditional to match the template for test_bill_detail couple of fixes for failing tests on develop Aug 3, 2024
@elarroba elarroba self-assigned this Aug 4, 2024
@elarroba elarroba self-requested a review August 4, 2024 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants