コード例 #1
0
 def test_convert_anon_user(self):
     """
     Tests for convert_django_user_to_xblock_user behavior when django user is AnonymousUser.
     """
     django_user_service = DjangoXBlockUserService(self.anon_user)
     xb_user = django_user_service.get_current_user()
     assert xb_user.is_current_user
     self.assert_is_anon_xb_user(xb_user)
コード例 #2
0
 def test_convert_authenticate_user(self):
     """
     Tests for convert_django_user_to_xblock_user behavior when django user is User.
     """
     django_user_service = DjangoXBlockUserService(self.user)
     xb_user = django_user_service.get_current_user()
     assert xb_user.is_current_user
     self.assert_xblock_user_matches_django(xb_user, self.user)
コード例 #3
0
 def test_convert_authenticate_user(self, user_is_staff, user_role, anonymous_user_id, request_country_code):
     """
     Tests for convert_django_user_to_xblock_user behavior when django user is User.
     """
     django_user_service = DjangoXBlockUserService(
         self.user,
         user_is_staff=user_is_staff,
         user_role=user_role,
         anonymous_user_id=anonymous_user_id,
         request_country_code=request_country_code,
     )
     xb_user = django_user_service.get_current_user()
     assert xb_user.is_current_user
     self.assert_xblock_user_matches_django(
         xb_user, self.user,
         user_is_staff,
         user_role,
         anonymous_user_id,
         request_country_code,
     )