Make the tests passing again

Made some django 1.7 fixes and fixture corrections
This commit is contained in:
Nik Nyby 2015-03-04 13:55:14 -05:00
parent d1a2d9d104
commit 1c36fb0e0c
4 changed files with 149 additions and 355 deletions

View File

@ -8,6 +8,7 @@ parent = os.path.dirname(os.path.dirname(
sys.path.insert(0, parent)
import django
from django.test import TestCase
from django.template import Template, Context
from django.core.management import call_command
@ -23,6 +24,12 @@ CHOICES = (
(2, 'Two'),
)
try:
# required by Django 1.7 and later
django.setup()
except:
pass
class ExampleForm(forms.Form):
char_field = forms.CharField()
choice_field = forms.ChoiceField(choices=CHOICES)

View File

@ -1,210 +1,99 @@
<div class="form-group">
<label class="control-label " for="id_char_field">Char field</label>
<div class=" ">
<input class=" form-control" id="id_char_field" name="char_field" type="text" />
</div>
<label class="control-label " for="id_char_field">Char field</label>
<div class=" ">
<input class=" form-control" id="id_char_field" name="char_field" type="text" />
</div>
</div>
<div class="form-group">
<label class="control-label " for="id_choice_field">Choice field</label>
<div class=" ">
<select class=" form-control" id="id_choice_field" name="choice_field">
<option value="0">Zero</option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
</div>
<label class="control-label " for="id_choice_field">Choice field</label>
<div class=" ">
<select class=" form-control" id="id_choice_field" name="choice_field">
<option value="0">Zero</option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label ">Radio choice</label>
<div class="">
<div class="radio">
<label>
<input name="radio_choice" type="radio" value="0" />
Zero
</label>
</div>
<div class="radio">
<label>
<input name="radio_choice" type="radio" value="1" />
One
</label>
</div>
<div class="radio">
<label>
<input name="radio_choice" type="radio" value="2" />
Two
</label>
</div>
<label class="control-label ">Radio choice</label>
<div class="">
<div class="radio">
<label>
<input id="id_radio_choice_0" name="radio_choice" type="radio" value="0" />
Zero
</label>
</div>
<div class="radio">
<label>
<input id="id_radio_choice_1" name="radio_choice" type="radio" value="1" />
One
</label>
</div>
<div class="radio">
<label>
<input id="id_radio_choice_2" name="radio_choice" type="radio" value="2" />
Two
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label " for="id_multiple_choice">Multiple choice</label>
<div class=" ">
<select multiple="multiple" class=" form-control" id="id_multiple_choice" name="multiple_choice">
<option value="0">Zero</option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
</div>
<label class="control-label " for="id_multiple_choice">Multiple choice</label>
<div class=" ">
<select multiple="multiple" class=" form-control" id="id_multiple_choice" name="multiple_choice">
<option value="0">Zero</option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label " for="id_multiple_checkbox">Multiple checkbox</label>
<div class=" multiple-checkbox">
<ul id="id_multiple_checkbox">
<li><label for="id_multiple_checkbox_0"><input id="id_multiple_checkbox_0" name="multiple_checkbox" type="checkbox" value="0" /> Zero</label></li>
<li><label for="id_multiple_checkbox_1"><input id="id_multiple_checkbox_1" name="multiple_checkbox" type="checkbox" value="1" /> One</label></li>
<li><label for="id_multiple_checkbox_2"><input id="id_multiple_checkbox_2" name="multiple_checkbox" type="checkbox" value="2" /> Two</label></li>
</ul>
</div>
<label class="control-label " for="id_multiple_checkbox">Multiple checkbox</label>
<div class=" multiple-checkbox">
<ul id="id_multiple_checkbox">
<li><label for="id_multiple_checkbox_0"><input id="id_multiple_checkbox_0" name="multiple_checkbox" type="checkbox" value="0" /> Zero</label></li>
<li><label for="id_multiple_checkbox_1"><input id="id_multiple_checkbox_1" name="multiple_checkbox" type="checkbox" value="1" /> One</label></li>
<li><label for="id_multiple_checkbox_2"><input id="id_multiple_checkbox_2" name="multiple_checkbox" type="checkbox" value="2" /> Two</label></li>
</ul>
</div>
</div>
<div class="form-group">
<label class="control-label " for="id_file_fied">File fied</label>
<label class="control-label " for="id_file_fied">File fied</label>
<div class=" ">
<input id="id_file_fied" name="file_fied" type="file" />
</div>
<div class=" ">
<input id="id_file_fied" name="file_fied" type="file" />
</div>
</div>
<div class="form-group">
<label class="control-label " for="id_password_field">Password field</label>
<label class="control-label " for="id_password_field">Password field</label>
<div class=" ">
<input class=" form-control" id="id_password_field" name="password_field" type="password" />
</div>
<div class=" ">
<input class=" form-control" id="id_password_field" name="password_field" type="password" />
</div>
</div>
<div class="form-group">
<label class="control-label " for="id_textarea">Textarea</label>
<div class=" ">
<textarea class=" form-control" cols="40" id="id_textarea" name="textarea" rows="10">
</textarea>
</div>
<label class="control-label " for="id_textarea">Textarea</label>
<div class=" ">
<textarea class=" form-control" cols="40" id="id_textarea" name="textarea" rows="10">
</textarea>
</div>
</div>
<div class="form-group">
<div class="">
<div class="checkbox">
<label >
<input id="id_boolean_field" name="boolean_field" type="checkbox" /> <span>Boolean field</span>
</label>
</div>
<div class="">
<div class="checkbox">
<label >
<input id="id_boolean_field" name="boolean_field" type="checkbox" /> <span>Boolean field</span>
</label>
</div>
</div>
</div>

View File

@ -1,210 +1,102 @@
<div class="form-group">
<label class="control-label col-sm-2 col-lg-2 " for="id_char_field">Char field</label>
<label class="control-label col-sm-2 col-lg-2 " for="id_char_field">Char field</label>
<div class=" col-sm-10 col-lg-10 ">
<input class=" form-control" id="id_char_field" name="char_field" type="text" />
</div>
<div class=" col-sm-10 col-lg-10 ">
<input class=" form-control" id="id_char_field" name="char_field" type="text" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2 col-lg-2 " for="id_choice_field">Choice field</label>
<label class="control-label col-sm-2 col-lg-2 " for="id_choice_field">Choice field</label>
<div class=" col-sm-10 col-lg-10 ">
<select class=" form-control" id="id_choice_field" name="choice_field">
<option value="0">Zero</option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
</div>
<div class=" col-sm-10 col-lg-10 ">
<select class=" form-control" id="id_choice_field" name="choice_field">
<option value="0">Zero</option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2 col-lg-2 ">Radio choice</label>
<label class="control-label col-sm-2 col-lg-2 ">Radio choice</label>
<div class=" col-sm-10 col-lg-10">
<div class="radio">
<label>
<input name="radio_choice" type="radio" value="0" />
Zero
</label>
</div>
<div class="radio">
<label>
<input name="radio_choice" type="radio" value="1" />
One
</label>
</div>
<div class="radio">
<label>
<input name="radio_choice" type="radio" value="2" />
Two
</label>
</div>
<div class=" col-sm-10 col-lg-10">
<div class="radio">
<label>
<input id="id_radio_choice_0" name="radio_choice" type="radio" value="0" />
Zero
</label>
</div>
<div class="radio">
<label>
<input id="id_radio_choice_1" name="radio_choice" type="radio" value="1" />
One
</label>
</div>
<div class="radio">
<label>
<input id="id_radio_choice_2" name="radio_choice" type="radio" value="2" />
Two
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2 col-lg-2 " for="id_multiple_choice">Multiple choice</label>
<label class="control-label col-sm-2 col-lg-2 " for="id_multiple_choice">Multiple choice</label>
<div class=" col-sm-10 col-lg-10 ">
<select multiple="multiple" class=" form-control" id="id_multiple_choice" name="multiple_choice">
<option value="0">Zero</option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
</div>
<div class=" col-sm-10 col-lg-10 ">
<select multiple="multiple" class=" form-control" id="id_multiple_choice" name="multiple_choice">
<option value="0">Zero</option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2 col-lg-2 " for="id_multiple_checkbox">Multiple checkbox</label>
<div class=" col-sm-10 col-lg-10 multiple-checkbox">
<ul id="id_multiple_checkbox">
<li><label for="id_multiple_checkbox_0"><input id="id_multiple_checkbox_0" name="multiple_checkbox" type="checkbox" value="0" /> Zero</label></li>
<li><label for="id_multiple_checkbox_1"><input id="id_multiple_checkbox_1" name="multiple_checkbox" type="checkbox" value="1" /> One</label></li>
<li><label for="id_multiple_checkbox_2"><input id="id_multiple_checkbox_2" name="multiple_checkbox" type="checkbox" value="2" /> Two</label></li>
</ul>
</div>
<label class="control-label col-sm-2 col-lg-2 " for="id_multiple_checkbox">Multiple checkbox</label>
<div class=" col-sm-10 col-lg-10 multiple-checkbox">
<ul id="id_multiple_checkbox">
<li><label for="id_multiple_checkbox_0"><input id="id_multiple_checkbox_0" name="multiple_checkbox" type="checkbox" value="0" /> Zero</label></li>
<li><label for="id_multiple_checkbox_1"><input id="id_multiple_checkbox_1" name="multiple_checkbox" type="checkbox" value="1" /> One</label></li>
<li><label for="id_multiple_checkbox_2"><input id="id_multiple_checkbox_2" name="multiple_checkbox" type="checkbox" value="2" /> Two</label></li>
</ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2 col-lg-2 " for="id_file_fied">File fied</label>
<label class="control-label col-sm-2 col-lg-2 " for="id_file_fied">File fied</label>
<div class=" col-sm-10 col-lg-10 ">
<input id="id_file_fied" name="file_fied" type="file" />
</div>
<div class=" col-sm-10 col-lg-10 ">
<input id="id_file_fied" name="file_fied" type="file" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2 col-lg-2 " for="id_password_field">Password field</label>
<label class="control-label col-sm-2 col-lg-2 " for="id_password_field">Password field</label>
<div class=" col-sm-10 col-lg-10 ">
<input class=" form-control" id="id_password_field" name="password_field" type="password" />
</div>
<div class=" col-sm-10 col-lg-10 ">
<input class=" form-control" id="id_password_field" name="password_field" type="password" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2 col-lg-2 " for="id_textarea">Textarea</label>
<label class="control-label col-sm-2 col-lg-2 " for="id_textarea">Textarea</label>
<div class=" col-sm-10 col-lg-10 ">
<textarea class=" form-control" cols="40" id="id_textarea" name="textarea" rows="10">
</textarea>
</div>
<div class=" col-sm-10 col-lg-10 ">
<textarea class=" form-control" cols="40" id="id_textarea" name="textarea" rows="10">
</textarea>
</div>
</div>
<div class="form-group">
<div class=" col-sm-offset-2 col-sm-10 col-lg-offset-2 col-lg-10">
<div class="checkbox">
<label >
<input id="id_boolean_field" name="boolean_field" type="checkbox" /> <span>Boolean field</span>
</label>
</div>
<div class=" col-sm-offset-2 col-sm-10 col-lg-offset-2 col-lg-10">
<div class="checkbox">
<label >
<input id="id_boolean_field" name="boolean_field" type="checkbox" /> <span>Boolean field</span>
</label>
</div>
</div>
</div>

View File

@ -10,6 +10,12 @@ DATABASES = {
SITE_ID = 1
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
INSTALLED_APPS = [
'django.contrib.contenttypes',
'django.contrib.sites',