Skip to content
Snippets Groups Projects
Commit 9f92054c authored by Ned Batchelder's avatar Ned Batchelder
Browse files

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.
parent c3234c1c
No related branches found
No related tags found
No related merge requests found
......@@ -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):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment