From 3f4ee28e272364d686ad2cb1e8a6929bb2df8768 Mon Sep 17 00:00:00 2001 From: muzaffaryousaf Date: Thu, 29 Jan 2015 12:51:30 +0500 Subject: [PATCH] Refactoring the user service test. TNL-1185 --- common/djangoapps/xblock_django/tests/test_user_service.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/djangoapps/xblock_django/tests/test_user_service.py b/common/djangoapps/xblock_django/tests/test_user_service.py index 2f910de3c4..4c88590e4e 100644 --- a/common/djangoapps/xblock_django/tests/test_user_service.py +++ b/common/djangoapps/xblock_django/tests/test_user_service.py @@ -10,7 +10,7 @@ from xblock_django.user_service import ( ) from student.models import anonymous_id_for_user from student.tests.factories import UserFactory, AnonymousUserFactory -from opaque_keys.edx.locations import SlashSeparatedCourseKey +from opaque_keys.edx.keys import CourseKey class UserServiceTestCase(TestCase): @@ -80,9 +80,10 @@ class UserServiceTestCase(TestCase): """ Tests for anonymous_user_id method returns anonymous user id for a user. """ + course_key = CourseKey.from_string('edX/toy/2012_Fall') anon_user_id = anonymous_id_for_user( user=self.user, - course_id=SlashSeparatedCourseKey('edX', 'toy', '2012_Fall'), + course_id=course_key, save=True )