Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added a few more tests for `MultiValueDict`.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6715 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5903b0bdcdf160d668a5c0e534b1a51feb71dc57 1 parent c7181ec
Gary Wilson Jr. authored November 25, 2007
12  tests/regressiontests/datastructures/tests.py
@@ -25,11 +25,23 @@
25 25
 >>> d = MultiValueDict({'name': ['Adrian', 'Simon'], 'position': ['Developer']})
26 26
 >>> d['name']
27 27
 'Simon'
  28
+>>> d.get('name')
  29
+'Simon'
28 30
 >>> d.getlist('name')
29 31
 ['Adrian', 'Simon']
  32
+>>> d['lastname']
  33
+Traceback (most recent call last):
  34
+...
  35
+MultiValueDictKeyError: "Key 'lastname' not found in <MultiValueDict: {'position': ['Developer'], 'name': ['Adrian', 'Simon']}>"
  36
+>>> d.get('lastname')
  37
+
30 38
 >>> d.get('lastname', 'nonexistent')
31 39
 'nonexistent'
  40
+>>> d.getlist('lastname')
  41
+[]
32 42
 >>> d.setlist('lastname', ['Holovaty', 'Willison'])
  43
+>>> d.getlist('lastname')
  44
+['Holovaty', 'Willison']
33 45
 
34 46
 ### SortedDict #################################################################
35 47
 

0 notes on commit 5903b0b

Please sign in to comment.
Something went wrong with that request. Please try again.