From 378564d8bcc3872a281fd7d2973aa1eb2f47b59b Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Sat, 15 Jun 2013 15:10:09 +0200 Subject: [PATCH] Use newer discover runner and test on Python 3.3 and Django master --- .gitignore | 1 + .travis.yml | 21 ++++++++++++--------- appconf/test_settings.py | 6 +++++- appconf/tests/models.py | 3 ++- appconf/tests/tests.py | 10 ++++++---- requirements/tests.txt | 2 +- 6 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 2b7d416..da377c9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ MANIFEST *.egg-info *.egg docs/_build/ +.coverage \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 3559805..eb531e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ python: - "2.6" - "2.7" - "3.2" + - "3.3" before_install: - export PIP_USE_MIRRORS=true - export PIP_INDEX_URL=https://simple.crate.io/ @@ -18,18 +19,20 @@ script: - coverage run --branch --source=appconf `which django-admin.py` test appconf - coverage report --omit=appconf/test* env: - - DJANGO=1.3.5 - - DJANGO=1.4.3 - - DJANGO=1.5b2 -branches: - except: - - master + - DJANGO=1.3.7 + - DJANGO=1.4.5 + - DJANGO=1.5.1 + - DJANGO=master matrix: exclude: - python: "2.5" - env: DJANGO=1.5b2 + env: DJANGO=1.5.1 - python: "3.2" - env: DJANGO=1.3.5 + env: DJANGO=1.3.7 - python: "3.2" - env: DJANGO=1.4.3 + env: DJANGO=1.4.5 + - python: "3.3" + env: DJANGO=1.3.7 + - python: "3.3" + env: DJANGO=1.4.5 diff --git a/appconf/test_settings.py b/appconf/test_settings.py index 5b47938..4a41671 100644 --- a/appconf/test_settings.py +++ b/appconf/test_settings.py @@ -1,3 +1,5 @@ +import django + SITE_ID = 1 DATABASES = { @@ -15,5 +17,7 @@ INSTALLED_APPS = [ 'appconf.tests', ] -TEST_RUNNER = 'discover_runner.DiscoverRunner' +if django.VERSION[:2] < (1, 6): + TEST_RUNNER = 'discover_runner.DiscoverRunner' + SECRET_KEY = 'local' diff --git a/appconf/tests/models.py b/appconf/tests/models.py index 3e2aabe..a42ead3 100644 --- a/appconf/tests/models.py +++ b/appconf/tests/models.py @@ -61,5 +61,6 @@ class CustomHolderConf(AppConf): SIMPLE_VALUE = True class Meta: - holder = 'appconf.tests.models.custom_holder' # instead of django.conf.settings + # instead of django.conf.settings + holder = 'appconf.tests.models.custom_holder' prefix = 'custom_holder' diff --git a/appconf/tests/tests.py b/appconf/tests/tests.py index 33e44c4..790525d 100644 --- a/appconf/tests/tests.py +++ b/appconf/tests/tests.py @@ -4,8 +4,8 @@ from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from appconf.tests.models import (AppConf, TestConf, PrefixConf, - YetAnotherPrefixConf, SeparateConf, ProxyConf, - CustomHolderConf, custom_holder) + YetAnotherPrefixConf, SeparateConf, + ProxyConf, CustomHolderConf, custom_holder) class TestConfTests(TestCase): @@ -29,11 +29,13 @@ class TestConfTests(TestCase): custom_conf = TestConf(CUSTOM_VALUE='custom') self.assertEquals(custom_conf.CUSTOM_VALUE, 'custom') self.assertEquals(settings.TESTS_CUSTOM_VALUE, 'custom') - self.assertRaises(AttributeError, lambda: custom_conf.TESTS_CUSTOM_VALUE) + self.assertRaises(AttributeError, + lambda: custom_conf.TESTS_CUSTOM_VALUE) custom_conf.CUSTOM_VALUE_SETATTR = 'custom' self.assertEquals(settings.TESTS_CUSTOM_VALUE_SETATTR, 'custom') custom_conf.custom_value_lowercase = 'custom' - self.assertRaises(AttributeError, lambda: settings.custom_value_lowercase) + self.assertRaises(AttributeError, + lambda: settings.custom_value_lowercase) def test_init_kwargs_with_prefix(self): custom_conf = TestConf(TESTS_CUSTOM_VALUE2='custom2') diff --git a/requirements/tests.txt b/requirements/tests.txt index eebb730..3bad74e 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -1,3 +1,3 @@ flake8 coverage -django-discover-runner==0.3 \ No newline at end of file +django-discover-runner==1.0