Django

Code

Ticket #4337: 4337.diff

File 4337.diff, 0.9 kB (added by Gary Wilson <gary.wilson@gmail.com>, 2 years ago)
  • django/http/__init__.py

    old new  
    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

    old new  
    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