Ticket #4337: 4337.diff

File 4337.diff, 892 bytes (added by Gary Wilson <gary.wilson@…>, 8 years ago)
  • django/http/__init__.py

    === modified file 'django/http/__init__.py'
     
    121121        self._assert_mutable()
    122122        MultiValueDict.update(self, other_dict)
    123123
    124     def pop(self, key):
     124    def pop(self, key, default=None):
    125125        self._assert_mutable()
    126         return MultiValueDict.pop(self, key)
     126        return MultiValueDict.pop(self, key, default)
    127127
    128128    def popitem(self):
    129129        self._assert_mutable()
  • tests/regressiontests/httpwrappers/tests.py

    === modified file 'tests/regressiontests/httpwrappers/tests.py'
     
    166166>>> q.pop('foo')
    167167['bar', 'baz', 'another', 'hello']
    168168
     169>>> q.pop('foo', 'not there')
     170'not there'
     171
    169172>>> q.get('foo', 'not there')
    170173'not there'
    171174
Back to Top