From 353c6a30de98a1d24c4b50aefb4caa58d39809a3 Mon Sep 17 00:00:00 2001 From: Curtis Maloney Date: Wed, 27 May 2015 13:20:50 +1000 Subject: [PATCH 01/21] Make 1.8 compatible --- constance/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/constance/models.py b/constance/models.py index e341795..b1183e1 100644 --- a/constance/models.py +++ b/constance/models.py @@ -1,4 +1,5 @@ from django.db.models import signals +from django import VERSION def create_perm(app, created_models, verbosity, db, **kwargs): @@ -10,10 +11,11 @@ def create_perm(app, created_models, verbosity, db, **kwargs): from django.contrib.contenttypes.models import ContentType if ContentType._meta.installed and Permission._meta.installed: + extra = {} if VERSION >= (1, 8) else {'name': 'config'} content_type, created = ContentType.objects.get_or_create( - name='config', app_label='constance', - model='config') + model='config', + **extra) permission, created = Permission.objects.get_or_create( name='Can change config', From de4dc304f82c8d153383527a2d58c8d2d286c3d0 Mon Sep 17 00:00:00 2001 From: Curtis Maloney Date: Wed, 27 May 2015 13:38:41 +1000 Subject: [PATCH 02/21] Django master (1.9+) does not support Py3.2 --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 12fb035..13fd5ba 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,8 @@ envlist = py26-django-14, py27-django-14, {py26,py27,py32,py33,py34,pypy}-django-{15,16}, - {py27,py32,py33,py34,pypy}-django-{17,master} + {py27,py32,py33,py34,pypy}-django-17 + {py27,py33,py34,pypy}-django-master [testenv] basepython = From 3338d1c092f8c7130fead6bdb820292ea0c2a97f Mon Sep 17 00:00:00 2001 From: Charlie Hornsby Date: Tue, 2 Jun 2015 21:18:19 +0300 Subject: [PATCH 03/21] Implement override_config decorator for use in testing Subclass django.test.utils.override_settings for similar pattern Allow use as both TestCase decorator and context manager Support Django versions 1.4 to 1.8 --- constance/test/__init__.py | 1 + constance/test/utils.py | 75 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 constance/test/__init__.py create mode 100644 constance/test/utils.py diff --git a/constance/test/__init__.py b/constance/test/__init__.py new file mode 100644 index 0000000..0fb5524 --- /dev/null +++ b/constance/test/__init__.py @@ -0,0 +1 @@ +from .utils import override_config diff --git a/constance/test/utils.py b/constance/test/utils.py new file mode 100644 index 0000000..4ae0e8b --- /dev/null +++ b/constance/test/utils.py @@ -0,0 +1,75 @@ +from functools import wraps + +from django.test import SimpleTestCase +from django.test.utils import override_settings + +from .. import config + +__all__ = ('override_config',) + + +class override_config(override_settings): + """Decorator to modify constance setting for TestCase. + + Based on django.test.utils.override_settings. + """ + def __init__(self, **kwargs): + super(override_config, self).__init__(**kwargs) + self.original_values = {} + + def __call__(self, test_func): + """Modify the decorated function to override config values.""" + if isinstance(test_func, type): + if not issubclass(test_func, SimpleTestCase): + raise Exception( + "Only subclasses of Django SimpleTestCase can be " + "decorated with override_config") + return self.modify_test_case(test_func) + else: + @wraps(test_func) + def inner(*args, **kwargs): + with self: + return test_func(*args, **kwargs) + return inner + + def modify_test_case(self, test_case): + """Override the config by modifying TestCase methods. + + This method follows the Django <= 1.6 method of overriding the + _pre_setup and _post_teardown hooks rather than modifying the TestCase + itself. + """ + original_pre_setup = test_case._pre_setup + original_post_teardown = test_case._post_teardown + + def _pre_setup(inner_self): + self.enable() + original_pre_setup(inner_self) + + def _post_teardown(inner_self): + original_post_teardown(inner_self) + self.disable() + + test_case._pre_setup = _pre_setup + test_case._post_teardown = _post_teardown + + return test_case + + def enable(self): + """Store original config values and set overridden values.""" + # Store the original values to an instance variable + for config_key in self.options.keys(): + self.original_values[config_key] = getattr(config, config_key) + + # Update config with the overriden values + self.unpack_values(self.options) + + def disable(self): + """Set original values to the config.""" + self.unpack_values(self.original_values) + + @staticmethod + def unpack_values(options): + """Unpack values from the given dict to config.""" + for name, value in options.items(): + setattr(config, name, value) From 2bbffd5eec2e42897969e504551c16d4abbf5ba9 Mon Sep 17 00:00:00 2001 From: Charlie Hornsby Date: Tue, 2 Jun 2015 21:19:13 +0300 Subject: [PATCH 04/21] Add test cases for override_config Test usage of override_config in different forms Ensure flexibility between decorator and context manager --- tests/test_test_utils.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/test_test_utils.py diff --git a/tests/test_test_utils.py b/tests/test_test_utils.py new file mode 100644 index 0000000..313246d --- /dev/null +++ b/tests/test_test_utils.py @@ -0,0 +1,34 @@ +from django.test import TestCase + +from constance import config +from constance.test import override_config + + +class OverrideConfigFunctionDecoratorTestCase(TestCase): + """Test that the override_config decorator works correctly. + + Test usage of override_config on test method and as context manager. + """ + def test_default_value_is_true(self): + """Assert that the default value of config.BOOL_VALUE is True.""" + self.assertTrue(config.BOOL_VALUE) + + @override_config(BOOL_VALUE=False) + def test_override_config_on_method_changes_config_value(self): + """Assert that the method decorator changes config.BOOL_VALUE.""" + self.assertFalse(config.BOOL_VALUE) + + def test_override_config_as_context_manager_changes_config_value(self): + """Assert that the context manager changes config.BOOL_VALUE.""" + with override_config(BOOL_VALUE=False): + self.assertFalse(config.BOOL_VALUE) + + self.assertTrue(config.BOOL_VALUE) + + +@override_config(BOOL_VALUE=False) +class OverrideConfigClassDecoratorTestCase(TestCase): + """Test that the override_config decorator works on classes.""" + def test_override_config_on_class_changes_config_value(self): + """Asser that the class decorator changes config.BOOL_VALUE.""" + self.assertFalse(config.BOOL_VALUE) From 3ea96e75291de89c18cece8640728dbdcfd9502a Mon Sep 17 00:00:00 2001 From: Charlie Hornsby Date: Tue, 2 Jun 2015 22:00:03 +0300 Subject: [PATCH 05/21] Add documentation for override_config decorator --- docs/index.rst | 1 + docs/testing.rst | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 docs/testing.rst diff --git a/docs/index.rst b/docs/index.rst index 2980166..a6ffd9c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -133,6 +133,7 @@ More documentation :maxdepth: 2 backends + testing changes Indices and tables diff --git a/docs/testing.rst b/docs/testing.rst new file mode 100644 index 0000000..29c9e73 --- /dev/null +++ b/docs/testing.rst @@ -0,0 +1,41 @@ +Testing +======= + +Testing how your app behaves with different config values is achieved with the +:class:`override_config` class. This intentionally mirrors the use of Django's +:class:`~django.test.override_setting`. + +.. py:class:: override_config(**kwargs) + + Replace key-value pairs in config. + + +Usage +~~~~~ + +It can be used as a decorator at the :class:`~django.test.TestCase` level, the +method level and also as a +`context manager `_. + +.. code-block:: python + + from constance import config + from constance.test import override_config + + from django.test import TestCase + + + @override_config(YOUR_NAME="Arthur of Camelot") + class ExampleTestCase(TestCase): + + def test_what_is_your_name(self): + self.assertEqual(config.YOUR_NAME, "Arthur of Camelot") + + @override_config(YOUR_QUEST="To find the Holy Grail") + def test_what_is_your_quest(self): + self.assertEqual(config.YOUR_QUEST, "To find the Holy Grail") + + def test_what_is_your_favourite_color(self): + with override_config(YOUR_FAVOURITE_COLOR="Blue?"): + self.assertEqual(config.YOUR_FAVOURITE_COLOR, "Blue?") + From b44f5f5409069a8e0dfcabb8aca127ce218767bb Mon Sep 17 00:00:00 2001 From: Dan Poirier Date: Fri, 7 Aug 2015 08:14:26 -0400 Subject: [PATCH 06/21] Some fixes for recent Djangos * Add Django 1.8 to test environments in tox.ini * Update python versions supported by Django master in tox.ini * Don't load 'url' from template library 'future' - it is no longer available in Django master, and is not needed in Django 1.4 and later, which is as far back as django-constance tests * get_cache dropped from Django master * post_syncdb signal dropped * django.utils.importlib dropped There are still errors on some environments that I didn't try to address: * coverage seems broken on py32 * django-master seems currently broken on py27 (non-ASCII character somewhere, I expect django-master will be fixed soon since they still claim py27 support) * django14 seems broken: "NoReverseMatch: u"'admin" is not a registered namespace" --- constance/backends/database/__init__.py | 8 +++++++- constance/models.py | 8 +++++--- constance/templates/admin/constance/change_list.html | 1 - constance/utils.py | 5 ++++- tox.ini | 5 ++++- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/constance/backends/database/__init__.py b/constance/backends/database/__init__.py index aa1ceaa..4cd6a3b 100644 --- a/constance/backends/database/__init__.py +++ b/constance/backends/database/__init__.py @@ -1,6 +1,12 @@ from django.core.exceptions import ImproperlyConfigured from django.db.models.signals import post_save -from django.core.cache import get_cache + +try: + from django.core.cache import get_cache +except ImportError: + from django.core.cache import caches + def get_cache(name): + return caches[name] try: from django.core.cache.backends.locmem import LocMemCache diff --git a/constance/models.py b/constance/models.py index e341795..8142d52 100644 --- a/constance/models.py +++ b/constance/models.py @@ -1,7 +1,7 @@ from django.db.models import signals -def create_perm(app, created_models, verbosity, db, **kwargs): +def create_perm(*args, **kwargs): """ Creates a fake content type and permission to be able to check for permissions @@ -11,7 +11,6 @@ def create_perm(app, created_models, verbosity, db, **kwargs): if ContentType._meta.installed and Permission._meta.installed: content_type, created = ContentType.objects.get_or_create( - name='config', app_label='constance', model='config') @@ -21,4 +20,7 @@ def create_perm(app, created_models, verbosity, db, **kwargs): codename='change_config') -signals.post_syncdb.connect(create_perm, dispatch_uid="constance.create_perm") +if hasattr(signals, 'post_syncdb'): + signals.post_syncdb.connect(create_perm, dispatch_uid="constance.create_perm") +else: + signals.post_migrate.connect(create_perm, dispatch_uid="constance.create_perm") diff --git a/constance/templates/admin/constance/change_list.html b/constance/templates/admin/constance/change_list.html index 27e792c..7751b94 100644 --- a/constance/templates/admin/constance/change_list.html +++ b/constance/templates/admin/constance/change_list.html @@ -1,6 +1,5 @@ {% extends "admin/base_site.html" %} {% load admin_static admin_list i18n %} -{% load url from future %} {% block extrastyle %} diff --git a/constance/utils.py b/constance/utils.py index 96fc572..572d84a 100644 --- a/constance/utils.py +++ b/constance/utils.py @@ -1,4 +1,7 @@ -from django.utils.importlib import import_module +try: + from importlib import import_module +except ImportError: + from django.utils.importlib import import_module def import_module_attr(path): diff --git a/tox.ini b/tox.ini index 12fb035..0a5d1c0 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,8 @@ envlist = py26-django-14, py27-django-14, {py26,py27,py32,py33,py34,pypy}-django-{15,16}, - {py27,py32,py33,py34,pypy}-django-{17,master} + {py27,py32,py33,py34,pypy}-django-{17,18} + {py27,py34,py35,pypy}-django-{master} [testenv] basepython = @@ -12,6 +13,7 @@ basepython = py32: python3.2 py33: python3.3 py34: python3.4 + py35: python3.5 pypy: pypy deps = redis @@ -23,6 +25,7 @@ deps = django-15: Django>=1.5,<1.6 django-16: Django>=1.6,<1.7 django-17: Django>=1.7,<1.8 + django-18: Django>=1.8,<1.9 django-master: https://github.com/django/django/archive/master.zip usedevelop = true commands = From 60a7b792e2402b18847328a58df58d21026963f0 Mon Sep 17 00:00:00 2001 From: Jake Merdich Date: Wed, 19 Aug 2015 22:46:33 -0700 Subject: [PATCH 07/21] Work around for pip bug w/ Django zips --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 12fb035..5e2eada 100644 --- a/tox.ini +++ b/tox.ini @@ -23,7 +23,7 @@ deps = django-15: Django>=1.5,<1.6 django-16: Django>=1.6,<1.7 django-17: Django>=1.7,<1.8 - django-master: https://github.com/django/django/archive/master.zip + django-master: https://github.com/django/django/archive/master.tar.gz usedevelop = true commands = coverage run {envbindir}/django-admin.py test --settings=tests.settings -v2 From e1f9e52a080d7681d51e66143fa922f850992a87 Mon Sep 17 00:00:00 2001 From: Mario Rosa Date: Tue, 25 Aug 2015 07:54:11 -0400 Subject: [PATCH 08/21] Compatibility changes. Drop python 2.6, 3.2 Drop Django 1.4, 1.5, 1.6 Remove models.py under constance and move to an appconfig imported file. --- constance/admin.py | 16 ++++------------ constance/apps.py | 3 +++ constance/backends/database/__init__.py | 10 +++------- constance/{models.py => connect.py} | 15 ++++++++++----- .../templates/admin/constance/change_list.html | 1 - constance/utils.py | 3 +-- tests/test_admin.py | 7 +++++++ tests/urls.py | 11 ++++------- tox.ini | 15 ++++----------- 9 files changed, 36 insertions(+), 45 deletions(-) rename constance/{models.py => connect.py} (62%) diff --git a/constance/admin.py b/constance/admin.py index 6e68ee4..aba238b 100644 --- a/constance/admin.py +++ b/constance/admin.py @@ -4,6 +4,7 @@ import hashlib from operator import itemgetter from django import forms +from django.conf.urls import url from django.contrib import admin, messages from django.contrib.admin import widgets from django.contrib.admin.options import csrf_protect_m @@ -13,19 +14,10 @@ from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template.context import RequestContext from django.utils import six +from django.utils.encoding import smart_bytes from django.utils.formats import localize from django.utils.translation import ugettext_lazy as _ -try: - from django.utils.encoding import smart_bytes -except ImportError: - from django.utils.encoding import smart_str as smart_bytes - -try: - from django.conf.urls import patterns, url -except ImportError: # Django < 1.4 - from django.conf.urls.defaults import patterns, url - from . import LazyConfig, settings @@ -97,14 +89,14 @@ class ConstanceAdmin(admin.ModelAdmin): def get_urls(self): info = self.model._meta.app_label, self.model._meta.module_name - return patterns('', + return [ url(r'^$', self.admin_site.admin_view(self.changelist_view), name='%s_%s_changelist' % info), url(r'^$', self.admin_site.admin_view(self.changelist_view), name='%s_%s_add' % info), - ) + ] @csrf_protect_m def changelist_view(self, request, extra_context=None): diff --git a/constance/apps.py b/constance/apps.py index 77226f7..d24eaf8 100644 --- a/constance/apps.py +++ b/constance/apps.py @@ -5,3 +5,6 @@ from django.utils.translation import ugettext_lazy as _ class ConstanceConfig(AppConfig): name = 'constance' verbose_name = _('Constance') + + def ready(self): + from . import connect diff --git a/constance/backends/database/__init__.py b/constance/backends/database/__init__.py index aa1ceaa..9e0ad65 100644 --- a/constance/backends/database/__init__.py +++ b/constance/backends/database/__init__.py @@ -1,11 +1,7 @@ +from django.core.cache.backends.locmem import LocMemCache from django.core.exceptions import ImproperlyConfigured from django.db.models.signals import post_save -from django.core.cache import get_cache - -try: - from django.core.cache.backends.locmem import LocMemCache -except ImportError: - from django.core.cache.backends.locmem import CacheClass as LocMemCache +from django.core.cache import caches from .. import Backend from ... import settings @@ -25,7 +21,7 @@ class DatabaseBackend(Backend): "correctly. Make sure it's in your INSTALLED_APPS setting.") if settings.DATABASE_CACHE_BACKEND: - self._cache = get_cache(settings.DATABASE_CACHE_BACKEND) + self._cache = caches[settings.DATABASE_CACHE_BACKEND] if isinstance(self._cache, LocMemCache): raise ImproperlyConfigured( "The CONSTANCE_DATABASE_CACHE_BACKEND setting refers to a " diff --git a/constance/models.py b/constance/connect.py similarity index 62% rename from constance/models.py rename to constance/connect.py index e341795..6ab803d 100644 --- a/constance/models.py +++ b/constance/connect.py @@ -1,7 +1,12 @@ -from django.db.models import signals +import django +from django.db.models.signals import post_migrate +if django.VERSION >= (1, 8): + CONTENT_TYPE_EXTRA = {} +else: + CONTENT_TYPE_EXTRA = {'name': 'config'} -def create_perm(app, created_models, verbosity, db, **kwargs): +def create_perm(*args, **kwargs): """ Creates a fake content type and permission to be able to check for permissions @@ -11,9 +16,9 @@ def create_perm(app, created_models, verbosity, db, **kwargs): if ContentType._meta.installed and Permission._meta.installed: content_type, created = ContentType.objects.get_or_create( - name='config', app_label='constance', - model='config') + model='config', + **CONTENT_TYPE_EXTRA) permission, created = Permission.objects.get_or_create( name='Can change config', @@ -21,4 +26,4 @@ def create_perm(app, created_models, verbosity, db, **kwargs): codename='change_config') -signals.post_syncdb.connect(create_perm, dispatch_uid="constance.create_perm") +post_migrate.connect(create_perm, dispatch_uid="constance.create_perm") diff --git a/constance/templates/admin/constance/change_list.html b/constance/templates/admin/constance/change_list.html index 27e792c..7751b94 100644 --- a/constance/templates/admin/constance/change_list.html +++ b/constance/templates/admin/constance/change_list.html @@ -1,6 +1,5 @@ {% extends "admin/base_site.html" %} {% load admin_static admin_list i18n %} -{% load url from future %} {% block extrastyle %} diff --git a/constance/utils.py b/constance/utils.py index 96fc572..7748453 100644 --- a/constance/utils.py +++ b/constance/utils.py @@ -1,5 +1,4 @@ -from django.utils.importlib import import_module - +from importlib import import_module def import_module_attr(path): package, module = path.rsplit('.', 1) diff --git a/tests/test_admin.py b/tests/test_admin.py index 5ac9521..51ebe74 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -44,3 +44,10 @@ class TestAdmin(TestCase): response = self.options.changelist_view(request, {}) self.assertEqual(response.status_code, 200) + + def test_str(self): + from django.utils import six + from django.contrib.contenttypes.models import ContentType + ct = ContentType.objects.get(app_label='constance', model='config') + + self.assertEqual(six.text_type(ct), 'config') diff --git a/tests/urls.py b/tests/urls.py index 6927e0e..12fe50c 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -1,11 +1,8 @@ from django.contrib import admin -try: - from django.conf.urls import patterns, include -except ImportError: - from django.conf.urls.defaults import patterns, include +from django.conf.urls import url, include -urlpatterns = patterns('', - (r'^admin/', include(admin.site.urls)), -) +urlpatterns = [ + url(r'^admin/', include(admin.site.urls)), +] diff --git a/tox.ini b/tox.ini index 12fb035..f8519cc 100644 --- a/tox.ini +++ b/tox.ini @@ -1,28 +1,21 @@ [tox] envlist = - py26-django-14, - py27-django-14, - {py26,py27,py32,py33,py34,pypy}-django-{15,16}, - {py27,py32,py33,py34,pypy}-django-{17,master} + {py27,py33,py34,pypy}-django-{17,18}, + {py27,py34,pypy}-django-{master} [testenv] basepython = - py26: python2.6 py27: python2.7 - py32: python3.2 py33: python3.3 py34: python3.4 + py35: python3.5 pypy: pypy deps = redis coverage django-picklefield - py26: unittest2 - django-{14,15}: django-discover-runner - django-14: Django>=1.4,<1.5 - django-15: Django>=1.5,<1.6 - django-16: Django>=1.6,<1.7 django-17: Django>=1.7,<1.8 + django-18: Django>=1.8,<1.9 django-master: https://github.com/django/django/archive/master.zip usedevelop = true commands = From 13768bc7ae86af7f1bced02adc814e3edffd43b0 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 24 Sep 2015 11:07:46 +0200 Subject: [PATCH 09/21] Fixed some Travis config issues --- .travis.yml | 29 ++++++++++------------------- tox.ini | 2 +- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1ea6172..db707c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,31 +1,22 @@ sudo: false language: python +cache: + directories: + - $HOME/.cache/pip install: - pip install tox env: - - TOXENV=py26-django-14 - - TOXENV=py27-django-14 - - TOXENV=py26-django-15 - - TOXENV=py26-django-16 - - TOXENV=py27-django-15 - - TOXENV=py27-django-16 - - TOXENV=py32-django-15 - - TOXENV=py32-django-16 - - TOXENV=py33-django-15 - - TOXENV=py33-django-16 - - TOXENV=py34-django-15 - - TOXENV=py34-django-16 - - TOXENV=pypy-django-15 - - TOXENV=pypy-django-16 - TOXENV=py27-django-17 - - TOXENV=py27-django-master - - TOXENV=py32-django-17 - - TOXENV=py32-django-master + - TOXENV=py27-django-18 - TOXENV=py33-django-17 - - TOXENV=py33-django-master + - TOXENV=py33-django-18 - TOXENV=py34-django-17 - - TOXENV=py34-django-master + - TOXENV=py34-django-18 - TOXENV=pypy-django-17 + - TOXENV=pypy-django-18 + - TOXENV=py27-django-master + - TOXENV=py34-django-master + - TOXENV=py35-django-master - TOXENV=pypy-django-master script: - tox diff --git a/tox.ini b/tox.ini index 479758d..a4ff486 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = {py27,py33,py34,pypy}-django-{17,18}, - {py27,py34,35,pypy}-django-{master} + {py27,py34,py35,pypy}-django-{master} [testenv] basepython = From b36aaf8fa6d2e23e7c9149966e0af5bdc85c4b10 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 24 Sep 2015 11:56:19 +0200 Subject: [PATCH 10/21] More test fixes. --- constance/admin.py | 19 +++++++++++-------- tests/test_admin.py | 5 ++--- tox.ini | 4 +++- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/constance/admin.py b/constance/admin.py index aba238b..44f7f79 100644 --- a/constance/admin.py +++ b/constance/admin.py @@ -3,7 +3,7 @@ from decimal import Decimal import hashlib from operator import itemgetter -from django import forms +from django import forms, VERSION from django.conf.urls import url from django.contrib import admin, messages from django.contrib.admin import widgets @@ -11,8 +11,7 @@ from django.contrib.admin.options import csrf_protect_m from django.core.exceptions import PermissionDenied, ImproperlyConfigured from django.forms import fields from django.http import HttpResponseRedirect -from django.shortcuts import render_to_response -from django.template.context import RequestContext +from django.template.response import TemplateResponse from django.utils import six from django.utils.encoding import smart_bytes from django.utils.formats import localize @@ -86,6 +85,7 @@ class ConstanceForm(forms.Form): class ConstanceAdmin(admin.ModelAdmin): + change_list_template = 'admin/constance/change_list.html' def get_urls(self): info = self.model._meta.app_label, self.model._meta.module_name @@ -143,10 +143,11 @@ class ConstanceAdmin(admin.ModelAdmin): 'form_field': form[name], }) context['config'].sort(key=itemgetter('name')) - context_instance = RequestContext(request, - current_app=self.admin_site.name) - return render_to_response('admin/constance/change_list.html', - context, context_instance=context_instance) + request.current_app = self.admin_site.name + # compatibility to be removed when 1.7 is deprecated + extra = {'current_app': self.admin_site.name} if VERSION < (1, 8) else {} + return TemplateResponse(request, self.change_list_template, context, + **extra) def has_add_permission(self, *args, **kwargs): return False @@ -166,10 +167,12 @@ class Config(object): object_name = 'Config' model_name = module_name = 'config' verbose_name_plural = _('config') - get_ordered_objects = lambda x: False abstract = False swapped = False + def get_ordered_objects(self): + return False + def get_change_permission(self): return 'change_%s' % self.model_name diff --git a/tests/test_admin.py b/tests/test_admin.py index 51ebe74..19493a1 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -1,7 +1,9 @@ from django.contrib import admin from django.contrib.auth.models import User, Permission +from django.contrib.contenttypes.models import ContentType from django.core.exceptions import PermissionDenied from django.test import TestCase, RequestFactory +from django.utils import six from constance.admin import settings, Config @@ -46,8 +48,5 @@ class TestAdmin(TestCase): self.assertEqual(response.status_code, 200) def test_str(self): - from django.utils import six - from django.contrib.contenttypes.models import ContentType ct = ContentType.objects.get(app_label='constance', model='config') - self.assertEqual(six.text_type(ct), 'config') diff --git a/tox.ini b/tox.ini index a4ff486..40fd450 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = {py27,py33,py34,pypy}-django-{17,18}, - {py27,py34,py35,pypy}-django-{master} + {py27,py34,py35,pypy}-django-master [testenv] basepython = @@ -21,3 +21,5 @@ usedevelop = true commands = coverage run {envbindir}/django-admin.py test --settings=tests.settings -v2 coverage report +setenv = + PYTHONDONTWRITEBYTECODE=1 From 7f5ca04f25b524b961feda80ef1a9d408e85e0a9 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 24 Sep 2015 12:00:30 +0200 Subject: [PATCH 11/21] Don't use 3.5 on Travis as it doesn't have it yet. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 40fd450..f021048 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = {py27,py33,py34,pypy}-django-{17,18}, - {py27,py34,py35,pypy}-django-master + {py27,py33,py34,pypy}-django-master [testenv] basepython = From e41710616b3544271aac283460d750ee8638f6df Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 24 Sep 2015 12:21:29 +0200 Subject: [PATCH 12/21] Allow line breaks in config descriptions - Fix #95 --- .../templates/admin/constance/change_list.html | 2 +- tests/settings.py | 17 +++++++++++++++++ tests/test_admin.py | 8 ++++++++ tox.ini | 3 ++- 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/constance/templates/admin/constance/change_list.html b/constance/templates/admin/constance/change_list.html index 7751b94..d284ffd 100644 --- a/constance/templates/admin/constance/change_list.html +++ b/constance/templates/admin/constance/change_list.html @@ -63,7 +63,7 @@ {% for item in config %} {{ item.name }} -
{{ item.help_text }}
+
{{ item.help_text|linebreaksbr }}
{{ item.default }} diff --git a/tests/settings.py b/tests/settings.py index 04a428a..bce6f88 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -63,6 +63,7 @@ CONSTANCE_CONFIG = { 'FLOAT_VALUE': (3.1415926536, 'PI'), 'DATE_VALUE': (date(2010, 12, 24), 'Merry Chrismas'), 'TIME_VALUE': (time(23, 59, 59), 'And happy New Year'), + 'LINEBREAK_VALUE': ('Spam spam', 'eggs\neggs'), } DEBUG = True @@ -70,3 +71,19 @@ DEBUG = True STATIC_ROOT = './static/' STATIC_URL = '/static/' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] diff --git a/tests/test_admin.py b/tests/test_admin.py index 19493a1..5ad5806 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -50,3 +50,11 @@ class TestAdmin(TestCase): def test_str(self): ct = ContentType.objects.get(app_label='constance', model='config') self.assertEqual(six.text_type(ct), 'config') + + def test_linebreaks(self): + self.client.login(username='admin', password='nimda') + request = self.rf.get('/admin/constance/config/') + request.user = self.superuser + response = self.options.changelist_view(request, {}) + self.assertContains(response, 'LINEBREAK_VALUE') + self.assertContains(response, 'eggs
eggs') diff --git a/tox.ini b/tox.ini index f021048..8884bd0 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,8 @@ deps = django-master: https://github.com/django/django/archive/master.tar.gz usedevelop = true commands = - coverage run {envbindir}/django-admin.py test --settings=tests.settings -v2 + coverage run {envbindir}/django-admin.py test -v2 coverage report setenv = PYTHONDONTWRITEBYTECODE=1 + DJANGO_SETTINGS_MODULE=tests.settings From 1a8ac8a97df183d3bd600ca8c2f1a4272c522a9c Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 24 Sep 2015 12:25:43 +0200 Subject: [PATCH 13/21] sigh, more travis/tox fixes. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index db707c3..f873499 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,8 @@ env: - TOXENV=pypy-django-17 - TOXENV=pypy-django-18 - TOXENV=py27-django-master + - TOXENV=py33-django-master - TOXENV=py34-django-master - - TOXENV=py35-django-master - TOXENV=pypy-django-master script: - tox From 20e424898c7a11f0d140bce3c8366e544d977cbc Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 24 Sep 2015 12:29:14 +0200 Subject: [PATCH 14/21] sigh, more travis/tox fixes. --- .travis.yml | 1 - tox.ini | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f873499..d94555d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,6 @@ env: - TOXENV=pypy-django-17 - TOXENV=pypy-django-18 - TOXENV=py27-django-master - - TOXENV=py33-django-master - TOXENV=py34-django-master - TOXENV=pypy-django-master script: diff --git a/tox.ini b/tox.ini index 8884bd0..4449e06 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = {py27,py33,py34,pypy}-django-{17,18}, - {py27,py33,py34,pypy}-django-master + {py27,py34,pypy}-django-master [testenv] basepython = From 527bc0ca7e90b115caf38475616b21edc090fe9f Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 24 Sep 2015 12:37:35 +0200 Subject: [PATCH 15/21] Updated Chinese translation. --- constance/locale/zh_CN/LC_MESSAGES/django.mo | Bin 956 -> 1440 bytes constance/locale/zh_CN/LC_MESSAGES/django.po | 21 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/constance/locale/zh_CN/LC_MESSAGES/django.mo b/constance/locale/zh_CN/LC_MESSAGES/django.mo index 92c32d1cc1b971cc1ef1d0d3a8e31a22463081f1..d9efd21fc28cefc8f71681f133b1b1c12b742ea3 100644 GIT binary patch literal 1440 zcmZva&2Jk;7{&)E1x)!62j~Hbkx)rOwf4FsB5VjkxUGoPgs3%@daBmDv-XDdthF=W9jF&K9$6UsI4fD_w_+XU4=Rg;H85Cd%ya+x6{sA5U{{){0{{r6x4?fwkzujd9 zEWkbtJ`Jvd2f=kv<=+5PU>*DcIkrKi$wKm1K>?ltuYk(`5vbx@pz?bR9tQvJ+7F|M z`u_$v1-=D71%_RF6;yGHUDiO9O?ps$Ax$zMgBGGnW zVZ}Bjv!TMWm=I3rdDS$TLKbqyoMj{r5k2P;EVRHF?`5NfDix^Ub4HmbSWjEPJm0hv zd5#~HsmW~`FcB8YuB25z45(Eyd69`UIjcG*-SYvuN7q{kG9CCc%#zxKt(|3oaD8r2 zdj{dY*7Hi8X6hKVNl|od?W3?Lw7hT7)buBLEf+9TB1$`sUJZIo&kk$Ztaj{OntjjE zM~>=QU5BG~n$5Z@d*5$F)8EmuBQ!f|4C_aAjMOPpNG%_jTzIDR1B0G(osgaj>HC52 z%MWKv>$7UrNn3vT1Nib{Xcn24XJ*-;xsuBnE^bgQ%pp2hlColCGIMitX{j>04x3kz znHjcVvxUt5CNo|)VP>IpJ~x#aN=;5op6DM+Hm#>}K9`I`A|8uDC7YL-if6ifOr3au zyBz;Ce^MLm`>DbX3$zp5!W-d5gN_zl+0$;&q*iL$3j@>BPU1F&L3t(Fit+3i?JURj zu~h$g$G2}p>#O}eZGW-U{I%Y`@k@LCX5ZX+uoN$E##cXY?5#(4)|&Trqw8Nb9_;LU z^3AU=MvD(0KfK!7+-mIA<2&E|`_emqeqX#m+PiD5`Uc!c`_>BTka%q~s@+oV%iFEJ zOC-Kri>`bdfAe#^ayP19k5}(^G?A#b)cpP~=|~{0`fm^#ZT-~Tz1F(6X&PIIUHZ-X!%iBs;A}Hy--}U~(>F)mlV>aGv delta 433 zcmZ3$y@$R2o)F7a1|Z-8Vi_Q=0b)TQz5~P{puot$AONHlfiydiHUiQtK-vmOa|3C6 zAgv6fy`kdyP`U(2vjW8{fixSCt_RYbK)MY`a{=iIKzb`9Lp{T6AOmE1ATvZk9FPWS z$N%YfkuNJ3$hRfKxTpf2beU5SPF6} z$ag?JV9S|+G{|>g;GCaVT#}fVoT`wVpO==IKKTu!$K>fub0%{$bFx@i85&P^U=~;O zO3cg4ELQMI%}hznQLxDZa~*QPT)oV^wEW2h%+_25Mfq8&$tA`51(P>2Z{m5nW5>(( g{+F%2&-bpIe3wOT@;??0$)^o_7$8Cn5P28{02j1PW&i*H diff --git a/constance/locale/zh_CN/LC_MESSAGES/django.po b/constance/locale/zh_CN/LC_MESSAGES/django.po index c469e1e..dbad41c 100644 --- a/constance/locale/zh_CN/LC_MESSAGES/django.po +++ b/constance/locale/zh_CN/LC_MESSAGES/django.po @@ -3,14 +3,15 @@ # This file is distributed under the same license as the PACKAGE package. # # Translators: +# Yifu Yu , 2015 msgid "" msgstr "" "Project-Id-Version: django-constance\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-11-27 19:05+0100\n" -"PO-Revision-Date: 2014-11-27 18:13+0000\n" -"Last-Translator: Jannis Leidel \n" -"Language-Team: Chinese (China) (http://www.transifex.com/projects/p/django-constance/language/zh_CN/)\n" +"PO-Revision-Date: 2015-03-15 18:40+0000\n" +"Last-Translator: Yifu Yu \n" +"Language-Team: Chinese (China) (http://www.transifex.com/jezdez/django-constance/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -22,13 +23,13 @@ msgstr "" msgid "" "Constance doesn't support config values of the type %(config_type)s. Please " "fix the value of '%(name)s'." -msgstr "" +msgstr "Constance不支持保存类型为%(config_type)s的值,请修正%(name)s的值。" #: admin.py:91 msgid "" "The settings have been modified by someone else. Please reload the form and " "resubmit your changes." -msgstr "" +msgstr "设置已经被他人修改过,请刷新页面并重新提交您的更改。" #: admin.py:129 msgid "Live settings updated successfully." @@ -36,7 +37,7 @@ msgstr "成功更新实时配置" #: admin.py:134 msgid "Constance config" -msgstr "常量配置" +msgstr "Constance 配置页面" #: admin.py:177 msgid "config" @@ -44,15 +45,15 @@ msgstr "配置" #: apps.py:9 msgid "Constance" -msgstr "" +msgstr "Constance模块" #: backends/database/models.py:19 msgid "constance" -msgstr "常量" +msgstr "Constance模块" #: backends/database/models.py:20 msgid "constances" -msgstr "常量" +msgstr "Constance模块" #: templates/admin/constance/change_list.html:50 msgid "Name" @@ -68,7 +69,7 @@ msgstr "值" #: templates/admin/constance/change_list.html:53 msgid "Is modified" -msgstr "是否修改" +msgstr "是否修改过" #: templates/admin/constance/change_list.html:79 msgid "Save" From 6fa03fdef87e5ea89711c804f56ecf8a8d8e8489 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 24 Sep 2015 12:46:52 +0200 Subject: [PATCH 16/21] Updated authors, changelog and docs config. --- AUTHORS | 42 +++++++++++++++++++++++++++++++++++++----- docs/changes.rst | 20 ++++++++++++++++++++ docs/conf.py | 2 +- docs/testing.rst | 5 ++--- 4 files changed, 60 insertions(+), 9 deletions(-) diff --git a/AUTHORS b/AUTHORS index d69ee00..5e065dd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,7 +1,39 @@ -Jiri Barton -Vojtech Jasny -Roman Krejcik -Jan Vesely Ales Zoulek -Jannis Leidel +Alexander frenzel Bouke Haarsma +Camilo Nova +Charlie Hornsby +Curtis Maloney +Dan Poirier +David Burke +Florian Apolloner +Igor Támara +Jake Merdich +Jannis Leidel +Janusz Harkot +Jiri Barton +Jonas +Kuba Zarzycki +Leandra Finger +Les Orchard +Lin Xianyi +Marcin Baran +Mario Orlandi +Mario Rosa +Mattia Larentis +Merijn Bertels +Omer Katz +Petr Knap +Philip Neustrom +Pierre-Olivier Marec +Roman Krejcik +Silvan Spross +Sławek Ehlert +Vojtech Jasny +Yin Jifeng +illumin-us-r3v0lution +mega +saw2th +trbs +vl <1844144@gmail.com> +vl diff --git a/docs/changes.rst b/docs/changes.rst index 20da8a6..374eaad 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -1,6 +1,26 @@ Changelog --------- +v1.1 (2015/09/24) +~~~~~~~~~~~~~~~~~ + +* **BACKWARD INCOMPATIBLE** Dropped support for Python 2.6 + The supported versions are 2.7, 3.3 (on Django < 1.9) and 3.4. + +* **BACKWARD INCOMPATIBLE** Dropped support for Django 1.4, 1.5 and 1.6 + The supported versions are 1.7, 1.8 and the upcoming 1.9 release + +* Added compatibility to Django 1.8 and 1.9. + +* Added Spanish and Chinese (``zh_CN``) translations. + +* Added :class:`override_config` decorator/context manager for easy + :doc:`testing `. + +* Added the ability to use linebreaks in config value help texts. + +* Various testing fixes. + v1.0.1 (2015/01/07) ~~~~~~~~~~~~~~~~~~~ diff --git a/docs/conf.py b/docs/conf.py index 2134a66..bdb5910 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -101,7 +101,7 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/docs/testing.rst b/docs/testing.rst index 29c9e73..8d092f1 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -7,8 +7,8 @@ Testing how your app behaves with different config values is achieved with the .. py:class:: override_config(**kwargs) - Replace key-value pairs in config. - + Replaces key-value pairs in the config. + Use as decorator or context manager. Usage ~~~~~ @@ -38,4 +38,3 @@ method level and also as a def test_what_is_your_favourite_color(self): with override_config(YOUR_FAVOURITE_COLOR="Blue?"): self.assertEqual(config.YOUR_FAVOURITE_COLOR, "Blue?") - From cc538fef504e8373f6fe68b79ba2cee4b2701708 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 24 Sep 2015 12:48:23 +0200 Subject: [PATCH 17/21] Added TEMPLATES setting to example app. --- example/cheeseshop/settings.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/example/cheeseshop/settings.py b/example/cheeseshop/settings.py index 049c3d9..9ad2ffc 100644 --- a/example/cheeseshop/settings.py +++ b/example/cheeseshop/settings.py @@ -72,6 +72,22 @@ TEMPLATE_LOADERS = ( # 'django.template.loaders.eggs.Loader', ) +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', From 6be3fb1398ac3bc9e3110d338c89311583d35a4b Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 24 Sep 2015 12:50:22 +0200 Subject: [PATCH 18/21] Happy new year! --- LICENSE | 2 +- docs/conf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index f1915ae..16e64b9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009-2014, Comoga and individual contributors +Copyright (c) 2009-2015, Comoga and individual contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/docs/conf.py b/docs/conf.py index bdb5910..e2b4bff 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,7 +46,7 @@ master_doc = 'index' # General information about the project. project = u'django-constance' -copyright = u'2014, Comoga and individual contributors' +copyright = u'2015, Comoga and individual contributors' # The short X.Y version. try: From a005625f97f9ab8704a7b4c9337501863e2c3ff6 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 24 Sep 2015 12:50:29 +0200 Subject: [PATCH 19/21] Bumped version. --- constance/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/constance/__init__.py b/constance/__init__.py index db2511f..ab64616 100644 --- a/constance/__init__.py +++ b/constance/__init__.py @@ -1,6 +1,6 @@ from django.utils.functional import LazyObject -__version__ = '1.0.1' +__version__ = '1.1' default_app_config = 'constance.apps.ConstanceConfig' From c82d76fc28a7c58be11050e29ddb96cd59beb608 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 1 Oct 2015 18:16:39 +0200 Subject: [PATCH 20/21] Fix #115 - stop shadowing the context processor's config variable when rendering the admin change list. --- constance/admin.py | 6 +++--- .../templates/admin/constance/change_list.html | 2 +- tests/settings.py | 13 +++++++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/constance/admin.py b/constance/admin.py index 44f7f79..58ba909 100644 --- a/constance/admin.py +++ b/constance/admin.py @@ -121,7 +121,7 @@ class ConstanceAdmin(admin.ModelAdmin): ) return HttpResponseRedirect('.') context = { - 'config': [], + 'config_values': [], 'title': _('Constance config'), 'app_label': 'constance', 'opts': Config._meta, @@ -134,7 +134,7 @@ class ConstanceAdmin(admin.ModelAdmin): # Then if the returned value is None, get the default if value is None: value = getattr(config, name) - context['config'].append({ + context['config_values'].append({ 'name': name, 'default': localize(default), 'help_text': _(help_text), @@ -142,7 +142,7 @@ class ConstanceAdmin(admin.ModelAdmin): 'modified': value != default, 'form_field': form[name], }) - context['config'].sort(key=itemgetter('name')) + context['config_values'].sort(key=itemgetter('name')) request.current_app = self.admin_site.name # compatibility to be removed when 1.7 is deprecated extra = {'current_app': self.admin_site.name} if VERSION < (1, 8) else {} diff --git a/constance/templates/admin/constance/change_list.html b/constance/templates/admin/constance/change_list.html index d284ffd..746e263 100644 --- a/constance/templates/admin/constance/change_list.html +++ b/constance/templates/admin/constance/change_list.html @@ -60,7 +60,7 @@
{% trans "Is modified" %}
- {% for item in config %} + {% for item in config_values %} {{ item.name }}
{{ item.help_text|linebreaksbr }}
diff --git a/tests/settings.py b/tests/settings.py index bce6f88..647a0e4 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -83,7 +83,20 @@ TEMPLATES = [ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', + 'constance.context_processors.config', ], }, }, ] + +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.contrib.auth.context_processors.auth', + 'django.core.context_processors.debug', + 'django.core.context_processors.i18n', + 'django.core.context_processors.media', + 'django.core.context_processors.static', + 'django.core.context_processors.tz', + 'django.core.context_processors.request', + 'django.contrib.messages.context_processors.messages', + 'constance.context_processors.config', +) From 6b04a3169e79f3d131391f5a1aebaace6ed962a3 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 1 Oct 2015 18:20:14 +0200 Subject: [PATCH 21/21] Bumped up version. --- constance/__init__.py | 2 +- docs/changes.rst | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/constance/__init__.py b/constance/__init__.py index ab64616..c4b9842 100644 --- a/constance/__init__.py +++ b/constance/__init__.py @@ -1,6 +1,6 @@ from django.utils.functional import LazyObject -__version__ = '1.1' +__version__ = '1.1.1' default_app_config = 'constance.apps.ConstanceConfig' diff --git a/docs/changes.rst b/docs/changes.rst index 374eaad..fedbe64 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -1,6 +1,13 @@ Changelog --------- +v1.1.1 (2015/10/01) +~~~~~~~~~~~~~~~~~~~ + +* Fixed a regression in the 1.1 release that prevented the rendering of the + admin view with constance values when using the context processor at the + same time. + v1.1 (2015/09/24) ~~~~~~~~~~~~~~~~~