def test_404_tried_urls_have_names(self):
        """
        Verifies that the list of URLs that come back from a Resolver404
        exception contains a list in the right format for printing out in
        the DEBUG 404 page with both the patterns and URL names, if available.
        """
        urls = 'regressiontests.urlpatterns_reverse.named_urls'
        # this list matches the expected URL types and names returned when
        # you try to resolve a non-existent URL in the first level of included
        # URLs in named_urls.py (e.g., '/included/non-existent-url')
        url_types_names = [
            [{'type': RegexURLPattern, 'name': 'named-url1'}],
            [{'type': RegexURLPattern, 'name': 'named-url2'}],
            [{'type': RegexURLPattern, 'name': None}],
            [{'type': RegexURLResolver}, {'type': RegexURLPattern, 'name': 'named-url3'}],
            [{'type': RegexURLResolver}, {'type': RegexURLPattern, 'name': 'named-url4'}],
            [{'type': RegexURLResolver}, {'type': RegexURLPattern, 'name': None}],
            [{'type': RegexURLResolver}, {'type': RegexURLResolver}],
        ]
        try:
            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), (len(url_types_names), len(e.args[0]['tried'])) % 'Wrong number of tried URLs returned.  Expected %s, got %s.')
            for tried, expected in zip(e.args[0]['tried'], url_types_names):
                for t, e in zip(tried, expected):
                    self.assertTrue(isinstance(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)
                        else:
                            self.assertEqual(t.name, e['name'], 'Wrong URL name.  Expected "%s", got "%s".' % (e['name'], t.name))
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/tests/regressiontests/urlpatterns_reverse/tests.py/ResolverTests.test_404_tried_urls_have_names/swapped operands of `%`