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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5acae9ea-ae51-438b-8c31-6b926581d3d1n%40googlegroups.com.

Reply via email to