1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

[1.5.x] Fixed #20237 -- Reenabled assertContains with binary parameter

Thanks Baptiste Mispelon for the review.
Backport of fe01404bb9 from master.
This commit is contained in:
Claude Paroz
2013-04-11 10:36:12 +02:00
parent 82b5e10e61
commit 427b59495e
4 changed files with 22 additions and 4 deletions

View File

@@ -70,6 +70,11 @@ def request_methods_view(request):
def return_unicode(request):
return render_to_response('unicode.html')
def return_undecodable_binary(request):
return HttpResponse(
b'%PDF-1.4\r\n%\x93\x8c\x8b\x9e ReportLab Generated PDF document http://www.reportlab.com'
)
def return_json_file(request):
"A view that parses and returns a JSON string as a file."
match = CONTENT_TYPE_RE.match(request.META['CONTENT_TYPE'])