mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Bug in0bd2c0c901. Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es> Backport of52b054824efrom main
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							1ecbc04624
						
					
				
				
					commit
					610cd06c3f
				
			| @@ -253,6 +253,16 @@ class HandlerRequestTests(SimpleTestCase): | ||||
|         self.assertEqual(response.status_code, 200) | ||||
|         self.assertEqual(b"".join(list(response)), b"streaming content") | ||||
|  | ||||
|     def test_async_streaming(self): | ||||
|         response = self.client.get("/async_streaming/") | ||||
|         self.assertEqual(response.status_code, 200) | ||||
|         msg = ( | ||||
|             "StreamingHttpResponse must consume asynchronous iterators in order to " | ||||
|             "serve them synchronously. Use a synchronous iterator instead." | ||||
|         ) | ||||
|         with self.assertWarnsMessage(Warning, msg): | ||||
|             self.assertEqual(b"".join(list(response)), b"streaming content") | ||||
|  | ||||
|  | ||||
| class ScriptNameTests(SimpleTestCase): | ||||
|     def test_get_script_name(self): | ||||
| @@ -329,3 +339,10 @@ class AsyncHandlerRequestTests(SimpleTestCase): | ||||
|             self.assertEqual( | ||||
|                 b"".join([chunk async for chunk in response]), b"streaming content" | ||||
|             ) | ||||
|  | ||||
|     async def test_async_streaming(self): | ||||
|         response = await self.async_client.get("/async_streaming/") | ||||
|         self.assertEqual(response.status_code, 200) | ||||
|         self.assertEqual( | ||||
|             b"".join([chunk async for chunk in response]), b"streaming content" | ||||
|         ) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user