mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			472 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			472 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from django.http import HttpRequest
 | |
| from django.test import SimpleTestCase, ignore_warnings
 | |
| from django.utils.deprecation import RemovedInDjango40Warning
 | |
| 
 | |
| 
 | |
| @ignore_warnings(category=RemovedInDjango40Warning)
 | |
| class TestDeprecatedIsAjax(SimpleTestCase):
 | |
|     def test_is_ajax(self):
 | |
|         request = HttpRequest()
 | |
|         self.assertIs(request.is_ajax(), False)
 | |
|         request.META['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'
 | |
|         self.assertIs(request.is_ajax(), True)
 |