Commit 3f4ee28e by muzaffaryousaf

Refactoring the user service test.

TNL-1185
parent 7b10d14f
......@@ -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
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment