Permalink
Browse files

Removing test_project from django-uni-form Reasons:

- Maintaining it will steal time from features development.
- We need to update it for every new version of Django, that makes it impossible to pass tests in every version.
- Tests that fail are usually unrelated to django-uni-form, they don't point bugs.
- If people want to explain a new feature they want to include, they can use pseudo code or explain themselves.
If we don't get what they want to do, then I would be worried.
- Test projects are not documentation, they are code. We better have a examples section within docs.
- Test projects are for apps that need them to do the testing, we have an isolated testing suite.
  • Loading branch information...
1 parent 39a4ce1 commit aa6b447e3a0e194384c1c9a68f5adfa18f31ea0c @maraujop maraujop committed Jun 28, 2011
View
@@ -5,4 +5,3 @@ include README.rst
recursive-include docs *
recursive-include uni_form/static *
recursive-include uni_form/templates *
-recursive-include test_project/test_app/templates/test_app *
View
No changes.
View
No changes.
View
@@ -1,22 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import os.path
-
-from django.core.management import execute_manager
-from django.core.management import setup_environ, execute_from_command_line
-
-try:
- import settings # Assumed to be in the same directory.
-except ImportError:
- sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
- sys.exit(1)
-
-# Get the uni_form package into our test instance
-sys.path.insert(0, settings.PROJECT_ROOT.replace('/test_project',''))
-
-
-setup_environ(settings)
-
-if __name__ == "__main__":
- execute_from_command_line()
@@ -1 +0,0 @@
-django
View
@@ -1,100 +0,0 @@
-# Django settings for test_project project.
-
-from distutils import version
-import os.path
-
-from os.path import join, abspath, dirname
-from django import get_version # TODO: remove when pre-CSRF token templatetags are no longer supported
-
-PROJECT_ROOT = abspath(dirname(__file__))
-PROJECT_ROOT = PROJECT_ROOT.replace('uni_form/tests/test_project','')
-
-
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
-
-ADMINS = (
- # ('Your Name', 'your_email@domain.com'),
-)
-
-MANAGERS = ADMINS
-
-DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-DATABASE_NAME = 'dev.db' # Or path to database file if using sqlite3.
-DATABASE_USER = '' # Not used with sqlite3.
-DATABASE_PASSWORD = '' # Not used with sqlite3.
-DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
-DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
-
-# Local time zone for this installation. Choices can be found here:
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
-# although not all choices may be available on all operating systems.
-# If running in a Windows environment this must be set to the same as your
-# system time zone.
-TIME_ZONE = 'America/Chicago'
-
-# Language code for this installation. All choices can be found here:
-# http://www.i18nguy.com/unicode/language-identifiers.html
-LANGUAGE_CODE = 'en-us'
-
-SITE_ID = 1
-
-# If you set this to False, Django will make some optimizations so as not
-# to load the internationalization machinery.
-USE_I18N = True
-
-# Absolute path to the directory that holds media.
-# Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = PROJECT_ROOT.replace('/test_project','/uni_form/media/uni_form')
-
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash if there is a path component (optional in other cases).
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
-MEDIA_URL = '/media/'
-
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
-# trailing slash.
-# Examples: "http://foo.com/media/", "/media/".
-ADMIN_MEDIA_PREFIX = '/media/'
-
-# Make this unique, and don't share it with anybody.
-SECRET_KEY = 'towk(yx^x3ydpj&ifv&f07lil+g9wld5x48o=i(fo_9sf@1=%6'
-
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.load_template_source',
- 'django.template.loaders.app_directories.load_template_source',
-# 'django.template.loaders.eggs.load_template_source',
-)
-
-
-
-MIDDLEWARE_CLASSES = (
- 'django.middleware.common.CommonMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- )
-
-# TODO: remove when pre-CSRF token templatetags are no longer supported
-django_version = get_version()
-OLD_DJANGO = True
-if version.LooseVersion(django_version) >= version.LooseVersion('1.1.2'):
- MIDDLEWARE_CLASSES += ('django.middleware.csrf.CsrfViewMiddleware',)
- OLD_DJANGO = False
-
-
-ROOT_URLCONF = 'test_project.urls'
-
-
-TEMPLATE_DIRS = (
- os.path.join(PROJECT_ROOT.replace('/test_project',''), "uni_form", "media", "uni_form"),
-)
-
-INSTALLED_APPS = (
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.sites',
- 'test_app',
- 'uni_form'
-)
No changes.
@@ -1,94 +0,0 @@
-from django import forms
-from django.template.loader import render_to_string
-
-from uni_form.helpers import FormHelper, Submit, Reset
-
-from uni_form.helpers import Layout, Fieldset, Column, Row, HTML
-
-CHOICES = (
- ("A", "Alpha"),
- ("B", "Bravo"),
- ("C", "Charlie"),
- )
-
-
-class TestForm(forms.Form):
-
- character_field = forms.CharField(label="Character Field", help_text="I am help text", max_length=30, required=True, widget=forms.TextInput())
- url_field = forms.URLField(label='URL field', verify_exists=False, max_length=100, required=True, widget=forms.TextInput())
- textarea_field = forms.CharField(label='Textareafield', required=True, widget=forms.Textarea())
- hidden_field = forms.CharField(label='textarea_field', required=True, widget=forms.HiddenInput())
- file_field = forms.FileField(label="File Field",required=False)
- password_field = forms.CharField(label='Password field', max_length=100, widget=forms.PasswordInput())
- boolean_field = forms.BooleanField(label="Boolean Field", required=False)
- choice_field = forms.ChoiceField(label="Choice Field", required=False, choices=CHOICES)
- multiple_choice_field = forms.MultipleChoiceField(label="multiple_choice_field", required=False, choices=CHOICES)
-
-
-
-class HelperTestForm(TestForm):
-
- # Attach a formHelper to your forms class.
- helper = FormHelper()
-
- # Add in a class and id
- helper.form_id = 'this-form-rocks'
- helper.form_class = 'search'
-
- # add in a submit and reset button
- submit = Submit('enter','enter some data')
- helper.add_input(submit)
- reset = Reset('reset','reset button')
- helper.add_input(reset)
-
-
-
-class LayoutTestForm(forms.Form):
-
- is_company = forms.CharField(label="company", required=False, widget=forms.CheckboxInput())
- email = forms.CharField(label="email", max_length=30, required=True, widget=forms.TextInput())
- password1 = forms.CharField(label="password", max_length=30, required=True, widget=forms.PasswordInput())
- password2 = forms.CharField(label="re-enter password", max_length=30, required=True, widget=forms.PasswordInput())
- first_name = forms.CharField(label="first name", max_length=30, required=True, widget=forms.TextInput())
- last_name = forms.CharField(label="last name", max_length=30, required=True, widget=forms.TextInput())
-
- # Attach a formHelper to your forms class.
- helper = FormHelper()
-
- # create some HTML that you want in the page
- style = """
- <style>
- .formRow {
- color: red;
- }
- </style>
-
- """
- # create the layout object
- layout = Layout(
- # first fieldset shows the company
- Fieldset('', 'is_company'),
-
- # second fieldset shows the contact info
- Fieldset('Contact details',
- HTML(style),
- 'email',
- Row('password1','password2'),
- 'first_name',
- 'last_name',
- )
- )
-
- helper.add_layout(layout)
-
- submit = Submit('add','Add this contact')
- helper.add_input(submit)
-
-class MessageResponseForm(forms.Form):
-
- character_field = forms.CharField(label="Character Field", help_text="I am help text", max_length=30, required=True, widget=forms.TextInput())
-
- def clean(self):
- cleaned_data = self.cleaned_data
- raise forms.ValidationError("This is a forced error")
- return cleaned_data
@@ -1,3 +0,0 @@
-from django.db import models
-
-# Create your models here.
@@ -1,138 +0,0 @@
-{% load uni_form_tags %}
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}" xml:lang="{{ LANGUAGE_CODE }}" lang="{{ LANGUAGE_CODE }}">
- <head>
- <!--
- Are these actually pulling in content? I don't want to use them, just want
- to see the results
-
- {% uni_form_setup %}
-
- -->
- <title>{% block head_title %}{% endblock %}</title>
-
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <meta http-equiv="Content-Type" content="text/html" />
-
- <!--[if IE]><style>
- div {
- zoom: 1; /* trigger hasLayout */
- }
- </style><![endif]-->
- <style>
- {% include "uni-form.css" %}
- </style>
- <style>
- /* You don't need these, they are here to tune up the page */
- html{ color: #343434; background: #bcc2c6 url(bg.png); font-size: 14px; line-height: 1.5; font-family: "Lucida Sans Unicode", "Lucida Grande", Arial, Verdana, sans-serif; }
- body{}
-
- a:link,
- a:visited{ text-decoration: none; color: #254a86; }
- a:hover,
- a:focus { text-decoration: underline; }
-
- h1,h2,h3,ul,ol,p{ margin: 1.5em 0; }
-
- h1{ margin: 42px auto 28px auto; width: 284px; }
- h2{ font-size: 1.25em; }
- .uniForm h2{ margin: 1em 0 1em 1.15em; }
- fieldset h3{ margin: 1.5em -28px; padding: 14px 28px; line-height: 1; background: #efefef; color: #343434; }
-
- .uniForm{ width: 55%; background: #fff; margin: 28px auto; padding: 28px;
- /* CSS3 */
- border-radius: 12px;
- -webkit-border-radius: 12px;
- -moz-border-radius: 12px;
- -o-border-radius: 12px;
- -khtml-border-radius: 12px;
- }
-
- .header{ margin: -28px -28px 28px -28px; padding: 1px 28px; background: #efefef; border-bottom: 1px solid #dfdfdf; position: relative;
- /* CSS3 */
- border-top-left-radius: 10px;
- border-top-right-radius: 10px;
- -webkit-border-top-left-radius: 10px;
- -webkit-border-top-right-radius: 10px;
- -moz-border-radius-topleft: 10px;
- -moz-border-radius-topright: 10px;
- }
- .header h2{ margin: 1.5em 0 0 0; color: #343434; color: #777; }
- .header p { margin-top: 0; font-size: 12px; color: #777; }
- .header .cta{ position: absolute; bottom: 26px; right: 28px; text-align: right; font-weight: bold; background: #194789; padding: 7px 14px;
- /* CSS3 */
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- -o-border-radius: 4px;
- -khtml-border-radius: 4px;
- text-shadow: -1px -1px 0 rgba(0,0,0,.25);
- }
- .header .cta:link,
- .header .cta:visited{ color: #fff; }
- .header .cta:focus,
- .header .cta:hover{ text-decoration: none;
- /* CSS3 */
- box-shadow: 0 0 9px rgba(0,163,255,1);
- -webkit-box-shadow: 0 0 9px rgba(0,163,255,1);
- -moz-box-shadow: 0 0 9px rgba(0,163,255,1);
- }
- .header .cta:active{ bottom: 25px; }
-
- .browse{ margin: 0; position: fixed; top: 28px; right: 28px; width: 84px; padding: 28px 28px 14px 28px; font-size: 12px; background: #97a2b0;
- /* CSS3 */
- border-radius: 12px;
- -webkit-border-radius: 12px;
- -moz-border-radius: 12px;
- -o-border-radius: 12px;
- -khtml-border-radius: 12px;
- }
- .browse h2{ font-size: 12px; margin: 0 0 14px 0; }
- .browse ul{ margin: 0; padding: 0; }
- .browse li{ margin: 0 0 14px 0; padding: 0; list-style: none; }
- .download{ float: right; position: relative; top: 2px; }
- .intro { width: 55%; margin: 28px auto; text-align: center; font-size: 1.15em; }
- #footer{ width: 55%; margin: 28px auto; text-align: center; font-size: .75em; color: #777; }
-
- /* IE6 fixes for the page */
- * html form.uniForm{ overflow: hidden; }
- * html .header{ zoom: 1; overflow: hidden;}
- * html .browse{ position: absolute; }
- </style>
-
- <style>
- {% include "default.uni-form.css" %}
- </style>
-
- {% block extra_head_base %}
- {% block extra_head %}{% endblock %}
- {% endblock %}
- </head>
- <body>
-
-
-
- <h1>{% block title%}{% endblock%}</h1>
-
- {% block body %}
- {% endblock %}
-
- <div class="browse">
- <h2>Test Pages</h2>
- <ul>
- <li><a href="{% url test_index %}">Basic test</a></li>
- <li><a href="{% url form_helper %}">Form Helper test</a></li>
- <li><a href="{% url view_helper %}">View Helper test</a></li>
- <li><a href="{% url layout_test %}">Layout test</a></li>
- <li><a href="{% url set_action_test %}">Set action test</a></li>
- <li><a href="{% url lacking_form_tag %}">Lacking form tag</a></li>
- <li><a href="{% url message_response %}">Message Response</a></li>
- <li><a href="{% url csrf_token_test %}">CSRF Token Test</a></li>
-
- </ul>
- </div>
-
-<script type="text/javascript">{% include "jquery.js" %}</script>
-<script type="text/javascript">{% include "uni-form.jquery.js" %}</script>
- </body>
-</html>
Oops, something went wrong.

0 comments on commit aa6b447

Please sign in to comment.