def test_process_request_admin_has_permission(self):
        # Make sure user has can_impersonate permission
        permission = Permission.objects.get_by_natural_key(
            'can_impersonate', 'accounts', 'user')
        self.admin.user_permissions.add(permission)
        self.admin.save()
        self.assertTrue(self.admin.has_perm('accounts.can_impersonate'))

        # Call the middleware
        middleware = ImpersonationMiddleware()
        request = self.request_factory.get('/')
        request.session = {'impersonate_id': self.user.pk}
        request.user = self.admin
        middleware.process_request(request)
        self.assertEqual(request.user, self.user)
Lower extent of the image in the x direction (in cm).
dataset/ETHPy150Open ofa/connect/open_connect/middleware/tests/test_impersonation.py/ImpersonationMiddlewareTest.test_process_request_admin_has_permission--crossover with--dataset/ETHPy150Open hyperion-rt/hyperion/hyperion/model/image.py/Image.x_min