Ticket #9089: multidict-tests-r9066.diff

File multidict-tests-r9066.diff, 1.2 KB (added by Ivan Giuliani, 16 years ago)
  • tests/regressiontests/utils/http.py

     
     1"""
     2>>> from django.utils.http import urlencode
     3
     4>>> urlencode({ 'a': 1, 'b': 2, 'c': 3})
     5'a=1&c=3&b=2'
     6
     7>>> from django.utils.datastructures import MultiValueDict
     8>>> urlencode(MultiValueDict({'name': ['Adrian', 'Simon'], 'position': ['Developer']}), doseq=True)
     9'position=Developer&name=Adrian&name=Simon'
     10>>> urlencode(MultiValueDict({'test': [1, 2, 3]}), doseq=True)
     11'test=1&test=2&test=3'
     12"""
  • tests/regressiontests/utils/tests.py

     
    99import timesince
    1010import datastructures
    1111import itercompat
     12import http
    1213from decorators import DecoratorFromMiddlewareTests
    1314
    1415# We need this because "datastructures" uses sorted() and the tests are run in
     
    2324    'timesince': timesince,
    2425    'datastructures': datastructures,
    2526    'itercompat': itercompat,
     27    'http': http,
    2628}
    2729
    2830class TestUtilsHtml(TestCase):
Back to Top