#23943: Audit tests decorated with unittest.expectedFailure
--------------------------------------+------------------------------------
     Reporter:  timgraham             |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Core (Other)          |                  Version:  master
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by diegoguimaraes):

 * cc: diegaogs@… (added)


Comment:

 While crossing references on those tests with the @expectedFailure
 decorator, this one seems that do not passes the audit
 `tests/generic_views/test_edit.py`:
 {{{
     @expectedFailure
     def test_update_put(self):
         a = Author.objects.create(
             name='Randall Munroe',
             slug='randall-munroe',
         )
         res = self.client.get('/edit/author/%d/update/' % a.pk)
         self.assertEqual(res.status_code, 200)
         self.assertTemplateUsed(res, 'generic_views/author_form.html')

         res = self.client.put('/edit/author/%d/update/' % a.pk,
                         {'name': 'Randall Munroe (author of xkcd)',
 'slug': 'randall-munroe'})
         # Here is the expected failure. PUT data are not processed in any
 special
         # way by django. So the request will equal to a POST without data,
 hence
         # the form will be invalid and redisplayed with errors (status
 code 200).
         # See also #12635
         self.assertEqual(res.status_code, 302)
         self.assertRedirects(res, 'http://testserver/list/authors/')
         self.assertQuerysetEqual(Author.objects.all(), ['<Author: Randall
 Munroe (author of xkcd)>'])

 }}}
 This test is related to ticket #12635 marked as wontfix, and according to
 the last comment on that, Using PUT and DELETE as HTTP methods for the
 form element is no longer supported (http://www.w3.org/TR/2010/WD-
 html5-diff-20101019/#changes-2010-06-24).

--
Ticket URL: <https://code.djangoproject.com/ticket/23943#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.efbc8f0d7a3d5f65aae30d96fb57e2e2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to