~ubuntu-branches/ubuntu/saucy/python-django/saucy-updates

« back to all changes in this revision

Viewing changes to tests/regressiontests/urlpatterns_reverse/views.py

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2014-04-22 23:12:52 UTC
  • Revision ID: package-import@ubuntu.com-20140422231252-8cu8s89mk8mik8ac
Tags: 1.5.4-1ubuntu1.2
* SECURITY REGRESSION: security fix regression when a view is a partial
  (LP: #1311433)
  - debian/patches/CVE-2014-0472-regression.patch: create the lookup_str
    from the original function whenever a partial is provided as an
    argument to a url pattern in django/core/urlresolvers.py,
    added tests to tests/regressiontests/urlpatterns_reverse/urls.py,
    tests/regressiontests/urlpatterns_reverse/views.py.
  - CVE-2014-0472

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from functools import partial, update_wrapper
 
2
 
1
3
from django.http import HttpResponse
2
4
from django.views.generic import RedirectView
3
5
from django.core.urlresolvers import reverse_lazy
45
47
 
46
48
def bad_view(request, *args, **kwargs):
47
49
    raise ValueError("I don't think I'm getting good value for this view")
 
50
 
 
51
 
 
52
empty_view_partial = partial(empty_view, template_name="template.html")
 
53
 
 
54
 
 
55
empty_view_wrapped = update_wrapper(
 
56
    partial(empty_view, template_name="template.html"), empty_view,
 
57
)