From c3234c1cfc8a5891238531ed582849b27228c290 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 18 Aug 2015 14:38:43 -0400 Subject: [PATCH 1/2] Upgrade Django to 1.4.22 https://www.djangoproject.com/weblog/2015/aug/18/security-releases/ --- requirements/edx/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 5f6b84ce9f..0a0fc2707b 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -34,7 +34,7 @@ django-storages==1.1.5 django-threaded-multihost==1.4-1 django-method-override==0.1.0 djangorestframework==2.3.14 -django==1.4.21 +django==1.4.22 elasticsearch==0.4.5 facebook-sdk==0.4.0 feedparser==5.1.3 From 9f92054ca7b91a589075579b4e56848b0e027238 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 19 Aug 2015 10:38:48 -0400 Subject: [PATCH 2/2] Fix tests to work with Django 1.4.22 The 1.4.22 security fix makes it so that empty sessions are not written. To keep the tests working, we now log in the user, so that some data is saved to the session. --- .../microsite_configuration/tests/test_middleware.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/djangoapps/microsite_configuration/tests/test_middleware.py b/common/djangoapps/microsite_configuration/tests/test_middleware.py index a96048fa18..771ce6f4bb 100644 --- a/common/djangoapps/microsite_configuration/tests/test_middleware.py +++ b/common/djangoapps/microsite_configuration/tests/test_middleware.py @@ -10,6 +10,8 @@ from django.test.client import Client from django.test.utils import override_settings import unittest +from student.tests.factories import UserFactory + # NOTE: We set SESSION_SAVE_EVERY_REQUEST to True in order to make sure # Sessions are always started on every request @@ -22,8 +24,13 @@ class MicroSiteSessionCookieTests(TestCase): def setUp(self): super(MicroSiteSessionCookieTests, self).setUp() - # create a test client + # Create a test client, and log it in so that it will save some session + # data. + self.user = UserFactory.create() + self.user.set_password('password') + self.user.save() self.client = Client() + self.client.login(username=self.user.username, password="password") def test_session_cookie_domain_no_microsite(self): """