Hello all,
I am not sure what I am doing incorrectly with the below test case information. I am simply trying to test the default authentication form of django 3.1. This test should be a good/True login test.
Here is the Test case:-----------------
class TestForms(TestCase):
def test_invalid_username(self):
# The user submits an invalid username.
data = {
'username': 'abc',
'password': 'password',
}
form = AuthenticationForm(None, data)
self.assertTrue(form.is_valid())
----------------------------
Here is what I am getting for output:
--------------------
FAIL: test_invalid_username (rucklogs.tests.TestForms)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/lonesoac0/django/rucker2021/rucklogs/tests.py", line 39, in test_invalid_username
self.assertTrue(form.is_valid())
AssertionError: False is not true
-------------------
As you can see in the attached screenshot, the user abc is a good user.
Thank you.