From 46786b4193e04d398532bbfc3dcf63c03c1793cb Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Sat, 19 Jul 2008 01:22:26 +0000 Subject: Fixed #7741: django.newforms is now django.forms. This is obviously a backwards-incompatible change. There's a warning upon import of django.newforms itself, but deeper imports will raise errors. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7971 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/forms/fields.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/regressiontests/forms/fields.py') diff --git a/tests/regressiontests/forms/fields.py b/tests/regressiontests/forms/fields.py index f266e7bc50..5855e58bc9 100644 --- a/tests/regressiontests/forms/fields.py +++ b/tests/regressiontests/forms/fields.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- tests = r""" ->>> from django.newforms import * ->>> from django.newforms.widgets import RadioFieldRenderer +>>> from django.forms import * +>>> from django.forms.widgets import RadioFieldRenderer >>> from django.core.files.uploadedfile import SimpleUploadedFile >>> import datetime >>> import time @@ -17,7 +17,7 @@ tests = r""" ########## Each Field class does some sort of validation. Each Field has a clean() method, -which either raises django.newforms.ValidationError or returns the "clean" +which either raises django.forms.ValidationError or returns the "clean" data -- usually a Unicode object, but, in some rare cases, a list. Each Field's __init__() takes at least these parameters: @@ -1153,29 +1153,29 @@ u'' ... return x ... >>> import os ->>> from django import newforms as forms +>>> from django import forms >>> path = forms.__file__ >>> path = os.path.dirname(path) + '/' >>> fix_os_paths(path) -'.../django/newforms/' +'.../django/forms/' >>> f = forms.FilePathField(path=path) >>> f.choices.sort() >>> fix_os_paths(f.choices) -[('.../django/newforms/__init__.py', '__init__.py'), ('.../django/newforms/__init__.pyc', '__init__.pyc'), ('.../django/newforms/fields.py', 'fields.py'), ('.../django/newforms/fields.pyc', 'fields.pyc'), ('.../django/newforms/forms.py', 'forms.py'), ('.../django/newforms/forms.pyc', 'forms.pyc'), ('.../django/newforms/models.py', 'models.py'), ('.../django/newforms/models.pyc', 'models.pyc'), ('.../django/newforms/util.py', 'util.py'), ('.../django/newforms/util.pyc', 'util.pyc'), ('.../django/newforms/widgets.py', 'widgets.py'), ('.../django/newforms/widgets.pyc', 'widgets.pyc')] +[('.../django/forms/__init__.py', '__init__.py'), ('.../django/forms/__init__.pyc', '__init__.pyc'), ('.../django/forms/fields.py', 'fields.py'), ('.../django/forms/fields.pyc', 'fields.pyc'), ('.../django/forms/forms.py', 'forms.py'), ('.../django/forms/forms.pyc', 'forms.pyc'), ('.../django/forms/models.py', 'models.py'), ('.../django/forms/models.pyc', 'models.pyc'), ('.../django/forms/util.py', 'util.py'), ('.../django/forms/util.pyc', 'util.pyc'), ('.../django/forms/widgets.py', 'widgets.py'), ('.../django/forms/widgets.pyc', 'widgets.pyc')] >>> f.clean('fields.py') Traceback (most recent call last): ... ValidationError: [u'Select a valid choice. That choice is not one of the available choices.'] >>> fix_os_paths(f.clean(path + 'fields.py')) -u'.../django/newforms/fields.py' +u'.../django/forms/fields.py' >>> f = forms.FilePathField(path=path, match='^.*?\.py$') >>> f.choices.sort() >>> fix_os_paths(f.choices) -[('.../django/newforms/__init__.py', '__init__.py'), ('.../django/newforms/fields.py', 'fields.py'), ('.../django/newforms/forms.py', 'forms.py'), ('.../django/newforms/models.py', 'models.py'), ('.../django/newforms/util.py', 'util.py'), ('.../django/newforms/widgets.py', 'widgets.py')] +[('.../django/forms/__init__.py', '__init__.py'), ('.../django/forms/fields.py', 'fields.py'), ('.../django/forms/forms.py', 'forms.py'), ('.../django/forms/models.py', 'models.py'), ('.../django/forms/util.py', 'util.py'), ('.../django/forms/widgets.py', 'widgets.py')] >>> f = forms.FilePathField(path=path, recursive=True, match='^.*?\.py$') >>> f.choices.sort() >>> fix_os_paths(f.choices) -[('.../django/newforms/__init__.py', '__init__.py'), ('.../django/newforms/extras/__init__.py', 'extras/__init__.py'), ('.../django/newforms/extras/widgets.py', 'extras/widgets.py'), ('.../django/newforms/fields.py', 'fields.py'), ('.../django/newforms/forms.py', 'forms.py'), ('.../django/newforms/models.py', 'models.py'), ('.../django/newforms/util.py', 'util.py'), ('.../django/newforms/widgets.py', 'widgets.py')] +[('.../django/forms/__init__.py', '__init__.py'), ('.../django/forms/extras/__init__.py', 'extras/__init__.py'), ('.../django/forms/extras/widgets.py', 'extras/widgets.py'), ('.../django/forms/fields.py', 'fields.py'), ('.../django/forms/forms.py', 'forms.py'), ('.../django/forms/models.py', 'models.py'), ('.../django/forms/util.py', 'util.py'), ('.../django/forms/widgets.py', 'widgets.py')] # SplitDateTimeField ########################################################## -- cgit v1.3