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/forms/forms.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/forms/forms.py')
| -rw-r--r-- | tests/regressiontests/forms/forms.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/regressiontests/forms/forms.py b/tests/regressiontests/forms/forms.py index 0088a4b995..9add15163a 100644 --- a/tests/regressiontests/forms/forms.py +++ b/tests/regressiontests/forms/forms.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- tests = r""" >>> from django.newforms import * +>>> from django.core.files.uploadedfile import SimpleUploadedFile >>> import datetime >>> import time >>> import re @@ -1465,7 +1466,7 @@ not request.POST. >>> print f <tr><th>File1:</th><td><ul class="errorlist"><li>This field is required.</li></ul><input type="file" name="file1" /></td></tr> ->>> f = FileForm(data={}, files={'file1': {'filename': 'name', 'content':''}}, auto_id=False) +>>> f = FileForm(data={}, files={'file1': SimpleUploadedFile('name', '')}, auto_id=False) >>> print f <tr><th>File1:</th><td><ul class="errorlist"><li>The submitted file is empty.</li></ul><input type="file" name="file1" /></td></tr> @@ -1473,7 +1474,7 @@ not request.POST. >>> print f <tr><th>File1:</th><td><ul class="errorlist"><li>No file was submitted. Check the encoding type on the form.</li></ul><input type="file" name="file1" /></td></tr> ->>> f = FileForm(data={}, files={'file1': {'filename': 'name', 'content':'some content'}}, auto_id=False) +>>> f = FileForm(data={}, files={'file1': SimpleUploadedFile('name', 'some content')}, auto_id=False) >>> print f <tr><th>File1:</th><td><input type="file" name="file1" /></td></tr> >>> f.is_valid() |
