#34902: django.test.client.Client.head request fails on AttributeError as_sync 
is
missing
-----------------------------------+--------------------------------------
     Reporter:  jelly              |                    Owner:  nobody
         Type:  Uncategorized      |                   Status:  closed
    Component:  Testing framework  |                  Version:  4.2
     Severity:  Normal             |               Resolution:  worksforme
     Keywords:                     |             Triage Stage:  Unreviewed
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => worksforme
 * component:  Uncategorized => Testing framework


Comment:

 Thanks for the report, however the following works for me with Django
 4.2.6:

 {{{#!diff
 diff --git a/tests/handlers/tests.py b/tests/handlers/tests.py
 index 0348b8e5d6..6bfa852db5 100644
 --- a/tests/handlers/tests.py
 +++ b/tests/handlers/tests.py
 @@ -253,6 +253,10 @@ class HandlerRequestTests(SimpleTestCase):
          self.assertEqual(response.status_code, 200)
          self.assertEqual(b"".join(list(response)), b"streaming content")

 +    def test_head_streaming(self):
 +        response = self.client.head("/streaming/")
 +        self.assertEqual(response.status_code, 200)
 +
      def test_async_streaming(self):
          response = self.client.get("/async_streaming/")
          self.assertEqual(response.status_code, 200)

 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34902#comment:1>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018b37daae3c-2e4c0334-108f-445f-a73e-34a5dbbf42f3-000000%40eu-central-1.amazonses.com.

Reply via email to