Ignore:
Timestamp:
13 Aug 2013, 13:26:17 (11 years ago)
Author:
uli
Message:

Update regression test to allow query params in arbitrary order.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.cas/trunk/waeup/cas/tests/test_server.py

    r10491 r10492  
    55import unittest
    66from paste.deploy import loadapp
     7from urlparse import parse_qsl
    78from webob import Request, Response
    89from webtest import TestApp as WebTestApp  # avoid py.test skip message
     
    432433        assert resp2.status == '303 See Other'
    433434        location = resp2.headers['Location']
    434         ticket_value = location[48:]
    435         exp_location = 'http://service.com/index.php'
    436         exp_location += '?authCAS=CAS&ticket=' + ticket_value
    437         # there is only one ticket value in response location
    438         assert len(ticket_value) == 32
    439         assert location == exp_location
     435        query_string = location.split('?', 1)[1]
     436        query_params = dict(parse_qsl(query_string))
     437        assert 'authCAS' in query_params.keys()
     438        assert 'ticket' in query_params.keys()
     439        assert len(query_params['ticket']) == 32
    440440
    441441
Note: See TracChangeset for help on using the changeset viewer.