Beispiel #1
0
 def test_reservations_default_user(self):
     '''
     Tests if we handle default logged in user
     '''
     thread_local.set_user(self.user1)
     self.assertRaises(models.AclAccessViolation, reservations.create,
                       ['reshost4'])
Beispiel #2
0
 def process_request(self, request):
     super(ApacheAuthMiddleware, self).process_request(request)
     username = thread_local.get_user()
     thread_local.set_user(None)
     user_object = auth.authenticate(username=username, password='')
     auth.login(request, user_object)
     thread_local.set_user(models.User.objects.get(login=username))
Beispiel #3
0
 def process_request(self, request):
     super(ApacheAuthMiddleware, self).process_request(request)
     username = thread_local.get_user()
     thread_local.set_user(None)
     user_object = auth.authenticate(username=username,
                                     password='')
     auth.login(request, user_object)
     thread_local.set_user(models.User.objects.get(login=username))
 def test_reservations_default_user(self):
     '''
     Tests if we handle default logged in user
     '''
     thread_local.set_user(self.user1)
     self.assertRaises(models.AclAccessViolation,
                       reservations.create,
                       ['reshost4'])
Beispiel #5
0
 def process_request(self, request):
     # look for a username from Apache
     user = request.META.get('REMOTE_USER')
     if user is None:
         # look for a user in headers.  This is insecure but
         # it's our temporarily solution for CLI auth.
         user = request.META.get('HTTP_AUTHORIZATION')
     if user is None:
         # no user info - assume we're in development mode
         user = DEBUG_USER
     thread_local.set_user(user)
Beispiel #6
0
 def process_request(self, request):
     # look for a username from Apache
     user = request.META.get('REMOTE_USER')
     if user is None:
         # look for a user in headers.  This is insecure but
         # it's our temporarily solution for CLI auth.
         user = request.META.get('HTTP_AUTHORIZATION')
     if user is None:
         # no user info - assume we're in development mode
         user = DEBUG_USER
     thread_local.set_user(user)
 def _frontend_common_teardown(self):
     setup_test_environment.tear_down()
     thread_local.set_user(None)
     self.god.unstub_all()
Beispiel #8
0
 def _frontend_common_teardown(self):
     setup_test_environment.tear_down()
     thread_local.set_user(None)
     self.god.unstub_all()