diff options
| author | Brian Rosner <brosner@gmail.com> | 2008-07-01 15:49:08 +0000 |
|---|---|---|
| committer | Brian Rosner <brosner@gmail.com> | 2008-07-01 15:49:08 +0000 |
| commit | 0e8710d5900a75b9a4a1caebb82c939896e99cff (patch) | |
| tree | f3db8fb3f6b932bfc48526a70c332efce66d5cac /tests/regressiontests/datastructures/tests.py | |
| parent | 595e9191f519af9b1c0c4b657fd3923c0997938c (diff) | |
newforms-admin: Merged from trunk up to [7814].
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7815 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/datastructures/tests.py')
| -rw-r--r-- | tests/regressiontests/datastructures/tests.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/tests/regressiontests/datastructures/tests.py b/tests/regressiontests/datastructures/tests.py index d6141b09ce..62c57bc019 100644 --- a/tests/regressiontests/datastructures/tests.py +++ b/tests/regressiontests/datastructures/tests.py @@ -117,14 +117,25 @@ Init from sequence of tuples >>> d['person']['2']['firstname'] ['Adrian'] -### FileDict ################################################################ - ->>> d = FileDict({'content': 'once upon a time...'}) ->>> repr(d) -"{'content': '<omitted>'}" ->>> d = FileDict({'other-key': 'once upon a time...'}) +### ImmutableList ################################################################ +>>> d = ImmutableList(range(10)) +>>> d.sort() +Traceback (most recent call last): + File "<stdin>", line 1, in <module> + File "/var/lib/python-support/python2.5/django/utils/datastructures.py", line 359, in complain + raise AttributeError, self.warning +AttributeError: ImmutableList object is immutable. >>> repr(d) -"{'other-key': 'once upon a time...'}" +'(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)' +>>> d = ImmutableList(range(10), warning="Object is immutable!") +>>> d[1] +1 +>>> d[1] = 'test' +Traceback (most recent call last): + File "<stdin>", line 1, in <module> + File "/var/lib/python-support/python2.5/django/utils/datastructures.py", line 359, in complain + raise AttributeError, self.warning +AttributeError: Object is immutable! ### DictWrapper ############################################################# |
