diff --git a/bootstrapform/fixtures/basic.html b/bootstrapform/fixtures/basic.html index 636dfe7..d316ca5 100644 --- a/bootstrapform/fixtures/basic.html +++ b/bootstrapform/fixtures/basic.html @@ -1,210 +1,99 @@ - - - - - - -
- - - - - -
- - - - - -
- + +
+ +
- - -
- - - - - -
- - - - - -
- + +
+ +
- - -
- - - - -
- -
- -
- -
- -
- -
- -
- - - - - + +
+
+
- + +
+ +
+ +
+ +
+
- - -
- - - - - -
- - - - - -
- + +
+ +
- - -
- - - - - -
-
    -
  • -
  • -
  • -
- - - - -
- + +
+
    +
  • +
  • +
  • +
+
- - -
- - - - + -
- - - - - -
- +
+ +
- - -
- - - - + -
- - - - - -
- +
+ +
- - -
- - - - - -
- - - - - -
- + +
+ +
- - -
- -
-
- - - - - - -
+
+
+
- +
- - diff --git a/bootstrapform/fixtures/horizontal.html b/bootstrapform/fixtures/horizontal.html index e49ee15..5634218 100644 --- a/bootstrapform/fixtures/horizontal.html +++ b/bootstrapform/fixtures/horizontal.html @@ -1,210 +1,102 @@ - - - - - - -
+ - - - - -
- - - - - -
- +
+ +
- - -
- - - - + -
- - - - - -
- +
+ +
- - -
+ - - - -
- -
- -
- -
- -
- -
- -
- - - - - +
+
+
- +
+ +
+
+ +
+
- - -
- - - - + -
- - - - - -
- +
+ +
- - -
- - - - - -
-
    -
  • -
  • -
  • -
- - - - -
- + +
+
    +
  • +
  • +
  • +
+
- - -
+ - - - - -
- - - - - -
- +
+ +
- - -
- - - - + -
- - - - - -
- +
+ +
- - -
- - - - + -
- - - - - -
- +
+ +
- - -
- -
-
- - - - - - -
+
+
+
- +
- - diff --git a/bootstrapform/tests.py b/bootstrapform/tests.py index 678dcdf..5b90058 100644 --- a/bootstrapform/tests.py +++ b/bootstrapform/tests.py @@ -1,5 +1,6 @@ import os +import django from django.test import TestCase from django.template import Template, Context from django.core.management import call_command @@ -15,6 +16,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) diff --git a/runtests.py b/runtests.py index 726d4c7..0efa252 100644 --- a/runtests.py +++ b/runtests.py @@ -44,7 +44,10 @@ def runtests(**test_args): parent = dirname(abspath(__file__)) sys.path.insert(0, parent) - django.setup() + try: + django.setup() + except: + pass TestRunner = get_runner(settings) test_runner = TestRunner(verbosity=1, interactive=True) diff --git a/tests/test_settings.py b/tests/test_settings.py new file mode 100644 index 0000000..2d5ccf9 --- /dev/null +++ b/tests/test_settings.py @@ -0,0 +1,47 @@ +import os +local_path = lambda path: os.path.join(os.path.dirname(__file__), path) + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': ':memory:' + } +} + +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', + 'django.contrib.sessions', + 'django.contrib.staticfiles', + 'django.contrib.auth', + 'django.contrib.admin', + 'bootstrapform', +] + +ROOT_URLCONF = 'tests.urls' + +MEDIA_URL = '/media/' + +MEDIA_ROOT = local_path('media') + +STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage' +STATIC_ROOT = local_path('static/') +STATIC_URL = '/static/' +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder' +) + +TEMPLATE_DIRS = ( + local_path('templates'), +) + +SECRET_KEY = 'django-bootstrap-form'