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

Tests for forms aren't working as expected. #33495

Open
BalaurZmeu opened this issue May 8, 2024 · 0 comments
Open

Tests for forms aren't working as expected. #33495

BalaurZmeu opened this issue May 8, 2024 · 0 comments
Labels
Content:Learn:Django Learning area Django docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@BalaurZmeu
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Testing

What specific section or headline is this issue about?

https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Testing#forms

What information was incorrect, unhelpful, or incomplete?

The last two tests which are testing forms are not passing.

def test_renew_form_date_today(self):
date = datetime.date.today()
form = RenewBookForm(data={'renewal_date': date})
self.assertTrue(form.is_valid())

def test_renew_form_date_max(self):
date = timezone.localtime() + datetime.timedelta(weeks=4)
form = RenewBookForm(data={'renewal_date': date})
self.assertTrue(form.is_valid())

These two are failing:
FAIL: test_renew_form_date_max (catalog.tests.test_forms.RenewBookFormTest)

Traceback (most recent call last):
File "/home/zmeu/code/Mozilla_Django_Tutorial/locallibrary/catalog/tests/test_forms.py", line 33, in test_renew_form_date_max
self.assertTrue(form.is_valid())
AssertionError: False is not true

======================================================================
FAIL: test_renew_form_date_today (catalog.tests.test_forms.RenewBookFormTest)

Traceback (most recent call last):
File "/home/zmeu/code/Mozilla_Django_Tutorial/locallibrary/catalog/tests/test_forms.py", line 28, in test_renew_form_date_today
self.assertTrue(form.is_valid())
AssertionError: False is not true


What did you expect to see?

I am following every instruction in the tutorial very carefully. I completed all challenges. I don't know what is wrong.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@BalaurZmeu BalaurZmeu added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 8, 2024
@github-actions github-actions bot added the Content:Learn:Django Learning area Django docs label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Learn:Django Learning area Django docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

No branches or pull requests

1 participant