Skip to content

Commit 19afa44

Browse files
committed
Changed the redirect tests to accept a set of correct redirect urls, rather than one single, since the queryarg order isn't stable across python versions.
- Legacy-Id: 16444
1 parent 01ece5b commit 19afa44

1 file changed

Lines changed: 20 additions & 16 deletions

File tree

ietf/redirects/tests.py

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright The IETF Trust 2009-2019, All Rights Reserved
2+
# -*- coding: utf-8 -*-
23
# Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
34
# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
45
#
@@ -32,6 +33,8 @@
3233
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3334

3435

36+
from __future__ import absolute_import, print_function, unicode_literals
37+
3538
from ietf.utils.test_utils import split_url, TestCase
3639

3740
import debug # pyflakes:ignore
@@ -46,46 +49,47 @@
4649
# idindex/idtracker
4750

4851
'/public/pidtracker.cgi?command=view_id&dTag=11171&rfc_flag=0':
49-
'/idtracker/11171/',
52+
('/idtracker/11171/', ),
5053
'/public/idindex.cgi?command=do_search_id&filename=draft-mills-sntp-v4-00.txt':
51-
'/drafts/?filename=draft-mills-sntp-v4-00.txt',
54+
('/drafts/?filename=draft-mills-sntp-v4-00.txt', ),
5255
'/public/idindex.cgi?command=do_search_id&filename=draft-ietf-isis-interoperable&search_button=SEARCH':
53-
'/drafts/?filename=draft-ietf-isis-interoperable&search_button=SEARCH',
56+
('/drafts/?filename=draft-ietf-isis-interoperable&search_button=SEARCH',
57+
'/drafts/?search_button=SEARCH&filename=draft-ietf-isis-interoperable'),
5458
'/public/idindex.cgi?command=do_search_id&filename=rfc0038.txt':
55-
'/drafts/?filename=rfc0038.txt',
59+
('/drafts/?filename=rfc0038.txt', ),
5660
'/public/idindex.cgi?command=id_detail&id=7096':
57-
'/drafts/7096/',
61+
('/drafts/7096/', ),
5862
'/public/idindex.cgi?command=view_related_docs&id=10845':
59-
'/drafts/10845/related/',
63+
('/drafts/10845/related/', ),
6064
'/public/idindex.cgi?command=id_detail&filename=draft-l3vpn-as4octet-ext-community':
61-
'/drafts/draft-l3vpn-as4octet-ext-community/',
65+
('/drafts/draft-l3vpn-as4octet-ext-community/', ),
6266
# non-ASCII parameter
6367
'/public/pidtracker.cgi?command=view_id&dTag=11171%D182&rfc_flag=0':
64-
'/idtracker/',
65-
'/idtracker/': '/doc/',
68+
('/idtracker/', ),
69+
'/idtracker/': ('/doc/', ),
6670

6771
# ipr
6872

6973
'/public/ipr_disclosure.cgi':
70-
'/ipr/about/',
74+
('/ipr/about/', ),
7175
'/public/ipr_detail_show.cgi?ipr_id=693':
72-
'/ipr/693/',
76+
('/ipr/693/', ),
7377

7478
# liaisons
7579

7680
'/public/liaison_detail.cgi?detail_id=340':
77-
'/liaison/340/',
81+
('/liaison/340/', ),
7882

7983
# meeting
8084

8185
'/public/meeting_agenda_html.cgi?meeting_num=72':
82-
'/meeting/72/agenda.html',
86+
('/meeting/72/agenda.html', ),
8387
'/public/meeting_materials.cgi?meeting_num=76':
84-
'/meeting/76/materials.html',
88+
('/meeting/76/materials.html', ),
8589

8690
# RedirectTrailingPeriod middleware
8791
'/sitemap.xml.':
88-
'/sitemap.xml'
92+
('/sitemap.xml', ),
8993

9094
}
9195

@@ -100,7 +104,7 @@ def test_redirects(self):
100104
location = response['Location']
101105
if location.startswith("http://testserver/"):
102106
location = location[17:]
103-
self.assertEqual(location, dst, (src, dst, location))
107+
self.assertIn(location, dst, (src, dst, location))
104108

105109
class MainUrlTests(TestCase):
106110
def test_urls(self):

0 commit comments

Comments
 (0)