diff --git a/lms/djangoapps/mobile_api/course_info/test_serializers.py b/lms/djangoapps/mobile_api/tests/test_serializers.py similarity index 100% rename from lms/djangoapps/mobile_api/course_info/test_serializers.py rename to lms/djangoapps/mobile_api/tests/test_serializers.py diff --git a/lms/djangoapps/mobile_api/course_info/test_views.py b/lms/djangoapps/mobile_api/tests/test_views.py similarity index 98% rename from lms/djangoapps/mobile_api/course_info/test_views.py rename to lms/djangoapps/mobile_api/tests/test_views.py index a348507de6da..2fc29050da6e 100644 --- a/lms/djangoapps/mobile_api/course_info/test_views.py +++ b/lms/djangoapps/mobile_api/tests/test_views.py @@ -291,20 +291,19 @@ def test_get_requested_user(self, user_role, username, expected_username, mock_g elif user_role == "staff": request_user = self.admin_user elif user_role == "student": - request_user = self.user + request_user = self.student_user self.request.user = request_user - if expected_username: - expected_user = User.objects.get(username=expected_username) - mock_get.return_value = expected_user - else: - expected_user = None + if expected_username == "student_user": + mock_user = self.student_user + mock_get.return_value = mock_user result_user = BlocksInfoInCourseView().get_requested_user(self.request.user, username) - if expected_user: + if expected_username: self.assertEqual(result_user.username, expected_username) - mock_get.assert_called_with(username=username) + if username: + mock_get.assert_called_with(username=username) else: self.assertIsNone(result_user)