summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2008-07-19 01:22:26 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2008-07-19 01:22:26 +0000
commit46786b4193e04d398532bbfc3dcf63c03c1793cb (patch)
tree8dfb9330ca0e377d89c29e3f67076231bbbbbc05 /tests/regressiontests/forms
parent39af2738fd64ba7f4c4af0783590e2b2b7b88460 (diff)
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
Diffstat (limited to 'tests/regressiontests/forms')
-rw-r--r--tests/regressiontests/forms/error_messages.py2
-rw-r--r--tests/regressiontests/forms/extra.py8
-rw-r--r--tests/regressiontests/forms/fields.py18
-rw-r--r--tests/regressiontests/forms/forms.py2
-rw-r--r--tests/regressiontests/forms/formsets.py4
-rw-r--r--tests/regressiontests/forms/media.py2
-rw-r--r--tests/regressiontests/forms/models.py2
-rw-r--r--tests/regressiontests/forms/regressions.py2
-rw-r--r--tests/regressiontests/forms/util.py6
-rw-r--r--tests/regressiontests/forms/widgets.py4
10 files changed, 25 insertions, 25 deletions
diff --git a/tests/regressiontests/forms/error_messages.py b/tests/regressiontests/forms/error_messages.py
index 580326f894..ec91b57a06 100644
--- a/tests/regressiontests/forms/error_messages.py
+++ b/tests/regressiontests/forms/error_messages.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
tests = r"""
->>> from django.newforms import *
+>>> from django.forms import *
>>> from django.core.files.uploadedfile import SimpleUploadedFile
# CharField ###################################################################
diff --git a/tests/regressiontests/forms/extra.py b/tests/regressiontests/forms/extra.py
index a8b369715d..80f7ef6535 100644
--- a/tests/regressiontests/forms/extra.py
+++ b/tests/regressiontests/forms/extra.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
tests = r"""
->>> from django.newforms import *
+>>> from django.forms import *
>>> from django.utils.encoding import force_unicode
>>> import datetime
>>> import time
@@ -14,12 +14,12 @@ tests = r"""
# Extra stuff #
###############
-The newforms library comes with some extra, higher-level Field and Widget
+The forms library comes with some extra, higher-level Field and Widget
classes that demonstrate some of the library's abilities.
# SelectDateWidget ############################################################
->>> from django.newforms.extras import SelectDateWidget
+>>> from django.forms.extras import SelectDateWidget
>>> w = SelectDateWidget(years=('2007','2008','2009','2010','2011','2012','2013','2014','2015','2016'))
>>> print w.render('mydate', '')
<select name="mydate_month" id="id_mydate_month">
@@ -424,7 +424,7 @@ u'sirrobin'
# Test overriding ErrorList in a form #
#######################################
->>> from django.newforms.util import ErrorList
+>>> from django.forms.util import ErrorList
>>> class DivErrorList(ErrorList):
... def __unicode__(self):
... return self.as_divs()
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 ##########################################################
diff --git a/tests/regressiontests/forms/forms.py b/tests/regressiontests/forms/forms.py
index 9add15163a..6e6e4f79bf 100644
--- a/tests/regressiontests/forms/forms.py
+++ b/tests/regressiontests/forms/forms.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
tests = r"""
->>> from django.newforms import *
+>>> from django.forms import *
>>> from django.core.files.uploadedfile import SimpleUploadedFile
>>> import datetime
>>> import time
diff --git a/tests/regressiontests/forms/formsets.py b/tests/regressiontests/forms/formsets.py
index dedc0a8e52..bbbd4cee5a 100644
--- a/tests/regressiontests/forms/formsets.py
+++ b/tests/regressiontests/forms/formsets.py
@@ -5,8 +5,8 @@ tests = """
FormSet allows us to use multiple instance of the same form on 1 page. For now,
the best way to create a FormSet is by using the formset_factory function.
->>> from django.newforms import Form, CharField, IntegerField, ValidationError
->>> from django.newforms.formsets import formset_factory, BaseFormSet
+>>> from django.forms import Form, CharField, IntegerField, ValidationError
+>>> from django.forms.formsets import formset_factory, BaseFormSet
>>> class Choice(Form):
... choice = CharField()
diff --git a/tests/regressiontests/forms/media.py b/tests/regressiontests/forms/media.py
index 3ea48876f5..d05db1f164 100644
--- a/tests/regressiontests/forms/media.py
+++ b/tests/regressiontests/forms/media.py
@@ -2,7 +2,7 @@
# Tests for the media handling on widgets and forms
media_tests = r"""
->>> from django.newforms import TextInput, Media, TextInput, CharField, Form, MultiWidget
+>>> from django.forms import TextInput, Media, TextInput, CharField, Form, MultiWidget
>>> from django.conf import settings
>>> ORIGINAL_MEDIA_URL = settings.MEDIA_URL
>>> settings.MEDIA_URL = 'http://media.example.com/media/'
diff --git a/tests/regressiontests/forms/models.py b/tests/regressiontests/forms/models.py
index c7ce128560..98b9233d80 100644
--- a/tests/regressiontests/forms/models.py
+++ b/tests/regressiontests/forms/models.py
@@ -15,7 +15,7 @@ class ChoiceModel(models.Model):
name = models.CharField(max_length=10)
__test__ = {'API_TESTS': """
->>> from django.newforms import form_for_model, form_for_instance
+>>> from django.forms import form_for_model, form_for_instance
# Boundary conditions on a PostitiveIntegerField #########################
>>> BoundaryForm = form_for_model(BoundaryModel)
diff --git a/tests/regressiontests/forms/regressions.py b/tests/regressiontests/forms/regressions.py
index cbc8095e60..87390d3cd1 100644
--- a/tests/regressiontests/forms/regressions.py
+++ b/tests/regressiontests/forms/regressions.py
@@ -3,7 +3,7 @@
tests = r"""
It should be possible to re-use attribute dictionaries (#3810)
->>> from django.newforms import *
+>>> from django.forms import *
>>> extra_attrs = {'class': 'special'}
>>> class TestForm(Form):
... f1 = CharField(max_length=10, widget=TextInput(attrs=extra_attrs))
diff --git a/tests/regressiontests/forms/util.py b/tests/regressiontests/forms/util.py
index bfaf73f6bc..68c082c114 100644
--- a/tests/regressiontests/forms/util.py
+++ b/tests/regressiontests/forms/util.py
@@ -1,17 +1,17 @@
# coding: utf-8
"""
-Tests for newforms/util.py module.
+Tests for forms/util.py module.
"""
tests = r"""
->>> from django.newforms.util import *
+>>> from django.forms.util import *
>>> from django.utils.translation import ugettext_lazy
###########
# flatatt #
###########
->>> from django.newforms.util import flatatt
+>>> from django.forms.util import flatatt
>>> flatatt({'id': "header"})
u' id="header"'
>>> flatatt({'class': "news", 'title': "Read this"})
diff --git a/tests/regressiontests/forms/widgets.py b/tests/regressiontests/forms/widgets.py
index e0837ab5b3..abb16cbcdf 100644
--- a/tests/regressiontests/forms/widgets.py
+++ b/tests/regressiontests/forms/widgets.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.utils.safestring import mark_safe
>>> import datetime
>>> import time