          response = self.client.post('/login/', {
              'username': 'testclient',
              'password': password,
          })
          self.assertContainsEscaped(response, AuthenticationForm.error_messages['invalid_login'])
  
      def logout(self):
          response = self.client.get('/logout/')
  
      def test_password_change_fails_with_invalid_old_password(self):
 
</s> remove                          [force_text(form.error_messages['invalid_login'])])
 </s> add                 [force_text(form.error_messages['invalid_login'] % {
                   'username': User._meta.get_field('username').verbose_name
                })]) </s> remove for a staff account. Note that both fields are case-sensitive."
 </s> add for a staff account. Note that both fields may be case-sensitive."
        self.assertContainsEscaped(response, AuthenticationForm.error_messages['invalid_login'] % {
                'username': User._meta.get_field('username').verbose_name
            })
          response = self.client.post('/login/', {
              'username': 'testclient',
              'password': password,
          })
        self.assertContainsEscaped(response, AuthenticationForm.error_messages['invalid_login'] % {
                'username': User._meta.get_field('username').verbose_name
            })
  
      def logout(self):
          response = self.client.get('/logout/')
  
      def test_password_change_fails_with_invalid_old_password(self):
keep keep keep keep replace keep keep keep keep keep
 Corrected tests depending on the error message on the AuthenticationForm.

Refs #19368, and the fix introduced in 27f8129d64292868f6a328f7bf9a1bed67967ff3. 
django/contrib/auth/tests/views.py