Ticket #13572: querydict-copy-encoding-tests.patch

File querydict-copy-encoding-tests.patch, 891 bytes (added by adammck, 14 years ago)
  • tests/regressiontests/httpwrappers/tests.py

     
    392392[u'bar', u'\ufffd']
    393393
    394394
     395#######################################
     396# QueryDict with non-default encoding #
     397#######################################
     398
     399>>> q = QueryDict('sbb=one', encoding='rot_13')
     400>>> q.encoding
     401'rot_13'
     402
     403>>> q.items()
     404[(u'foo', u'bar')]
     405
     406>>> q.urlencode()
     407'sbb=one'
     408
     409>>> q = q.copy()
     410>>> q.encoding
     411'rot_13'
     412
     413>>> q.items()
     414[(u'foo', u'bar')]
     415
     416>>> q.urlencode()
     417'sbb=one'
     418
     419>>> from copy import copy
     420>>> copy(q).encoding
     421'rot_13'
     422
     423>>> from copy import deepcopy
     424>>> deepcopy(q).encoding
     425'rot_13'
     426
     427
     428
    395429########################
    396430# Pickling a QueryDict #
    397431########################
Back to Top