зеркало из https://github.com/mozilla/commonware.git
No more import side effects for monkey patches.
This commit is contained in:
Родитель
f95a03a9b1
Коммит
d068435a9b
|
@ -1,2 +1,5 @@
|
|||
# Import monkeypatch code at startup.
|
||||
import commonware.response.cookies.monkeypatch
|
||||
from commonware.response.cookies.monkeypatch import patch_all
|
||||
|
||||
|
||||
patch_all()
|
||||
|
|
|
@ -55,4 +55,6 @@ def set_cookie_secure(f):
|
|||
return r
|
||||
return wrapped
|
||||
|
||||
HttpResponse.set_cookie = set_cookie_secure(HttpResponse.set_cookie)
|
||||
|
||||
def patch_all():
|
||||
HttpResponse.set_cookie = set_cookie_secure(HttpResponse.set_cookie)
|
||||
|
|
|
@ -2,7 +2,10 @@ from django.http import HttpResponse
|
|||
from mock import patch
|
||||
from nose.tools import eq_
|
||||
|
||||
import commonware.response.cookies.monkeypatch
|
||||
from commonware.response.cookies.monkeypatch import patch_all
|
||||
|
||||
|
||||
patch_all()
|
||||
|
||||
|
||||
def test_secure_cookies():
|
||||
|
|
Загрузка…
Ссылка в новой задаче