def test_user_requested_already_granted(self):
     add_user_with_status_granted(self.admin, self.user)
     self.assertEqual('granted', get_course_creator_status(self.user))
     # Will not "downgrade" to pending because that would require removing the
     # user from the authz course creator group (and that can only be done by an admin).
     user_requested_access(self.user)
     self.assertEqual('granted', get_course_creator_status(self.user))
示例#2
0
 def test_user_requested_already_granted(self):
     add_user_with_status_granted(self.admin, self.user)
     self.assertEqual('granted', get_course_creator_status(self.user))
     # Will not "downgrade" to pending because that would require removing the
     # user from the authz course creator group (and that can only be done by an admin).
     user_requested_access(self.user)
     self.assertEqual('granted', get_course_creator_status(self.user))
示例#3
0
    def test_user_requested_access(self):
        add_user_with_status_unrequested(self.user)
        self.assertEqual('unrequested', get_course_creator_status(self.user))

        request = RequestFactory().get('/')
        request.user = self.user

        mako_middleware_process_request(request)
        user_requested_access(self.user)
        self.assertEqual('pending', get_course_creator_status(self.user))
示例#4
0
    def test_user_requested_access(self):
        add_user_with_status_unrequested(self.user)
        self.assertEqual('unrequested', get_course_creator_status(self.user))

        request = RequestFactory().get('/')
        request.user = self.user

        mako_middleware_process_request(request)
        user_requested_access(self.user)
        self.assertEqual('pending', get_course_creator_status(self.user))
 def test_user_requested_access(self):
     add_user_with_status_unrequested(self.user)
     self.assertEqual('unrequested', get_course_creator_status(self.user))
     user_requested_access(self.user)
     self.assertEqual('pending', get_course_creator_status(self.user))
示例#6
0
def request_course_creator(request):
    """
    User has requested course creation access.
    """
    user_requested_access(request.user)
    return JsonResponse({"Status": "OK"})
示例#7
0
 def test_user_requested_access(self):
     add_user_with_status_unrequested(self.user)
     self.assertEqual('unrequested', get_course_creator_status(self.user))
     user_requested_access(self.user)
     self.assertEqual('pending', get_course_creator_status(self.user))
示例#8
0
文件: user.py 项目: gopinath81/vmss
def request_course_creator(request):
    """
    User has requested course creation access.
    """
    user_requested_access(request.user)
    return JsonResponse({"Status": "OK"})