              resolve('/included/non-existent-url', urlconf=urls)
              self.fail('resolve did not raise a 404')
          except Resolver404 as e:
              # make sure we at least matched the root ('/') url resolver:
              self.assertTrue('tried' in e.args[0])
              tried = e.args[0]['tried']
              self.assertEqual(len(e.args[0]['tried']), len(url_types_names), 'Wrong number of tried URLs returned.  Expected %s, got %s.' % (len(url_types_names), len(e.args[0]['tried'])))
              for tried, expected in zip(e.args[0]['tried'], url_types_names):
                  for t, e in zip(tried, expected):
                      self.assertIsInstance(t, e['type']), str('%s is not an instance of %s') % (t, e['type'])
                      if 'name' in e:
                          if not e['name']:
                              self.assertTrue(t.name is None, 'Expected no URL name but found %s.' % t.name)
 
</s> remove                     sub_tried = e.args[0].get('tried')
 </s> add                     sub_tried = e.tried </s> remove         tried = exception.args[0]['tried']
    except (IndexError, TypeError, KeyError):
 </s> add         tried = exception.tried
        error_url = exception.path
    except AttributeError: </s> remove             raise Resolver404({'tried': tried, 'path': new_path})
        raise Resolver404({'path': path})
 </s> add             raise Resolver404(new_path, tried=tried)
        raise Resolver404(path)
            self.assertTrue(hasattr(e, 'tried'))
            tried = e.tried
            self.assertEqual(len(tried), len(url_types_names), 'Wrong number of tried URLs returned.  Expected %s, got %s.' % (len(url_types_names), len(tried)))
            for tried, expected in zip(tried, url_types_names):
              resolve('/included/non-existent-url', urlconf=urls)
              self.fail('resolve did not raise a 404')
          except Resolver404 as e:
              # make sure we at least matched the root ('/') url resolver:
            self.assertTrue(hasattr(e, 'tried'))
            tried = e.tried
            self.assertEqual(len(tried), len(url_types_names), 'Wrong number of tried URLs returned.  Expected %s, got %s.' % (len(url_types_names), len(tried)))
            for tried, expected in zip(tried, url_types_names):
            self.assertTrue(hasattr(e, 'tried'))
            tried = e.tried
            self.assertEqual(len(tried), len(url_types_names), 'Wrong number of tried URLs returned.  Expected %s, got %s.' % (len(url_types_names), len(tried)))
            for tried, expected in zip(tried, url_types_names):
            self.assertTrue(hasattr(e, 'tried'))
            tried = e.tried
            self.assertEqual(len(tried), len(url_types_names), 'Wrong number of tried URLs returned.  Expected %s, got %s.' % (len(url_types_names), len(tried)))
            for tried, expected in zip(tried, url_types_names):
            self.assertTrue(hasattr(e, 'tried'))
            tried = e.tried
            self.assertEqual(len(tried), len(url_types_names), 'Wrong number of tried URLs returned.  Expected %s, got %s.' % (len(url_types_names), len(tried)))
            for tried, expected in zip(tried, url_types_names):
                  for t, e in zip(tried, expected):
                      self.assertIsInstance(t, e['type']), str('%s is not an instance of %s') % (t, e['type'])
                      if 'name' in e:
                          if not e['name']:
                              self.assertTrue(t.name is None, 'Expected no URL name but found %s.' % t.name)
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Fixed #18373 - improved handling of Resolver404s from views

When django.core.urlresolvers.resolve was called from a view, failed
and the exception was propagated and rendered by technical_404_response,
the URL mentioned on the page was the current URL instead of the URL
passed to resolve().

Fixed by using the path attribute from the Resolver404 exception instead
of request.path_info. Also cleaned up the exceptions to use standard
named parameters instead of stuffing a dict in args[0] 
tests/urlpatterns_reverse/tests.py