          def normal_view(request):
              pass
          login_required(normal_view)
  
      def testLoginRequired(self, view_url='/login_required/', login_url=settings.LOGIN_URL):
          """
          Check that login_required works on a simple view wrapped in a
          login_required decorator.
          """
          response = self.client.get(view_url)
 
</s> remove             # urlparse chokes on lazy objects in Python 3
            login_url_as_str = force_str(login_url or settings.LOGIN_URL)
 </s> add             resolved_login_url = resolve_url(login_url or settings.LOGIN_URL) </s> remove             login_scheme, login_netloc = urlparse(login_url_as_str)[:2]
 </s> add             login_scheme, login_netloc = urlparse(resolved_login_url)[:2]
    def testLoginRequired(self, view_url='/login_required/', login_url='/login/'):
          def normal_view(request):
              pass
          login_required(normal_view)
  
    def testLoginRequired(self, view_url='/login_required/', login_url='/login/'):
          """
          Check that login_required works on a simple view wrapped in a
          login_required decorator.
          """
          response = self.client.get(view_url)
keep keep keep keep replace keep keep keep keep keep
 Fixed #15552 -- LOGIN_URL and LOGIN_REDIRECT_URL can take URLpattern names.

Thanks UloPe and Eric Florenzano for the patch, and Malcolm Tredinnick for
review. 
django/contrib/auth/tests/decorators.py