[PATCH 11/11] settings: Fix deprecated 'TEST_CHARSET' warning

Finucane, Stephen stephen.finucane at intel.com
Sat Aug 22 00:09:53 AEST 2015


> > On Tue, Jun 30, 2015 at 09:52:09AM +0100, Stephen Finucane wrote:
> > > Resolve a 'RemovedInDjango19Warning' with the 'TEST_CHARSET' option.
> > >
> > > In addition, move a setting from 'settings.base' into the correct
> > > location.
> >
> > -> 2 patches! :)
> 
> Whoops!
> 
> > The documentation also mentions TEST_CHARSET.
> 
> Contrasting with my earlier statement on keeping support for Django 1.6,
> removing 1.6 support would negate the need for this patch. Maybe it should
> be done? Jeremy?

Looking at it now, the documentation is actually correct (it mentions that Django 1.7+ is different). I think I can leave it as is, at least until Django 1.6 support is removed.

> > --
> > Damien
> >
> > > Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>
> > > ---
> > >  patchwork/settings/base.py | 6 ++++--
> > >  patchwork/settings/dev.py  | 8 +++++++-
> > >  2 files changed, 11 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/patchwork/settings/base.py b/patchwork/settings/base.py
> > > index 5b40bcb..d00245d 100644
> > > --- a/patchwork/settings/base.py
> > > +++ b/patchwork/settings/base.py
> > > @@ -50,6 +50,10 @@ LANGUAGE_CODE = 'en-au'
> > >
> > >  USE_I18N = True
> > >
> > > +# Testing
> > > +
> > > +TEST_RUNNER = 'django.test.runner.DiscoverRunner'
> > > +
> > >  # URLs
> > >
> > >  ROOT_URLCONF = 'patchwork.urls'
> > > @@ -113,5 +117,3 @@ COMPAT_REDIR = True
> > >  # the scheme based on current access. This is useful if SSL protocol
> > >  # is terminated upstream of the server (e.g. at the load balancer)
> > >  FORCE_HTTPS_LINKS = False
> > > -
> > > -TEST_RUNNER = 'django.test.runner.DiscoverRunner'
> > > diff --git a/patchwork/settings/dev.py b/patchwork/settings/dev.py
> > > index 3f2355d..e93249c 100644
> > > --- a/patchwork/settings/dev.py
> > > +++ b/patchwork/settings/dev.py
> > > @@ -38,10 +38,16 @@ DATABASES = {
> > >          'USER': os.environ['PW_TEST_DB_USER'],
> > >          'PASSWORD': os.environ['PW_TEST_DB_PASS'],
> > >          'NAME': 'patchwork',
> > > -        'TEST_CHARSET': 'utf8',
> > >      },
> > >  }
> > >
> > > +if django.VERSION < (1, 7):
> > > +    DATABASES['default']['TEST_CHARSET'] = 'utf8'
> > > +else:
> > > +    DATABASES['default']['TEST'] = {
> > > +        'CHARSET': 'utf8',
> > > +    }
> > > +
> > >  #
> > >  # Patchwork settings
> > >  #
> > > --
> > > 2.0.0
> > >
> > > _______________________________________________
> > > Patchwork mailing list
> > > Patchwork at lists.ozlabs.org
> > > https://lists.ozlabs.org/listinfo/patchwork
> _______________________________________________
> Patchwork mailing list
> Patchwork at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork


More information about the Patchwork mailing list