From 5836b140fabbf24c05dea3a8862e65b281ded3ad Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 23 Nov 2006 17:16:15 +0000 Subject: [PATCH] newforms: Added unit test to test field order. Refs #3054 git-svn-id: http://code.djangoproject.com/svn/django/trunk@4092 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/forms/tests.py | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py index c4dd7074a5..73fa3c27bf 100644 --- a/tests/regressiontests/forms/tests.py +++ b/tests/regressiontests/forms/tests.py @@ -1202,6 +1202,39 @@ subclass' __init__(). First name: Last name: Birthday: + +A Form's fields are displayed in the same order in which they were defined. +>>> class TestForm(Form): +... field1 = CharField() +... field2 = CharField() +... field3 = CharField() +... field4 = CharField() +... field5 = CharField() +... field6 = CharField() +... field7 = CharField() +... field8 = CharField() +... field9 = CharField() +... field10 = CharField() +... field11 = CharField() +... field12 = CharField() +... field13 = CharField() +... field14 = CharField() +>>> p = TestForm() +>>> print p +Field1: +Field2: +Field3: +Field4: +Field5: +Field6: +Field7: +Field8: +Field9: +Field10: +Field11: +Field12: +Field13: +Field14: """ if __name__ == "__main__":