From 3d8e1d092cb14da360ca1515545c17088ece3e16 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Thu, 26 Feb 2015 12:23:31 -0500 Subject: [PATCH] Reload the user to get the cached profile attribute --- common/djangoapps/student/tests/test_login.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/djangoapps/student/tests/test_login.py b/common/djangoapps/student/tests/test_login.py index 1134f50b1e..e70b5ccac7 100644 --- a/common/djangoapps/student/tests/test_login.py +++ b/common/djangoapps/student/tests/test_login.py @@ -195,6 +195,9 @@ class LoginTest(TestCase): response = client1.post(self.url, creds) self._assert_response(response, success=True) + # Reload the user from the database + self.user = UserFactory.FACTORY_FOR.objects.get(pk=self.user.pk) + self.assertEqual(self.user.profile.get_meta()['session_id'], client1.session.session_key) # second login should log out the first