Commit graph

57 commits

Author SHA1 Message Date
Michael Käufl
6cb932e47f Run pyupgrade on the code
But don't touch string formatting.

https://pypi.org/project/pyupgrade/
2021-01-19 13:11:16 +06:00
John Franey
41b905c92e Update tested Python & Django versions
Replaces `django.utils.six` with `six` to support newer Django versions.

Updates Tox config to:
- remove unsupported Django versions
- add pypy3
- add Django 2.2
- update djmaster Python versions
2019-10-06 15:43:03 -04:00
Peter Bittner
0e45c7b3e4 Also move testing requirements into packaging setup 2018-12-09 15:52:05 +01:00
Daniel Hahler
9dcb47dc55
Fix utils.reraise for exceptions without args (#210)
This is the case for e.g. `bdb.BdbQuit`.
2018-08-30 21:15:31 +02:00
Daniel Hahler
ea060f0985 tox/Travis: use separate coverage factor
This will only install/run coverage on demand.
2018-08-26 02:00:52 +02:00
Daniel Hahler
8f199eb40c _setup: do not call django.setup() if settings are configured already
Without this, using `configurations.setup()` after Django has been setup
already re-triggers the logging configuration, which then causes e.g.
pytest's caplog to not work anymore.
2018-08-16 17:04:50 +02:00
Drew Winstel
a045609934 Drop obsolete Django 1.8 and 1.10 from Travis configs (#207)
* Drop obsolete versions of Django from Travis tests

Django 1.8 reached EOL in April 2018.
Django 1.10 reached EOL in December 2017.

* Add support for testing Django 2.0 and 2.1 on Python 3.7

* Drop obsolete test (requires Django < 1.10)
2018-08-16 17:03:31 +02:00
Mike
1c6fd0f505 Add PositiveIntegerValue to only allow positive integers (#186) 2018-03-15 13:19:50 +01:00
Daniel Hahler
d364802a8a Fix Django 2.0: use new url syntax (#182) 2017-10-05 02:42:34 +02:00
Nicolas Delaby
8f318991c2 Drop unmaintained version of django and python
- Drop django==1.9 as it reached end of life
- Drop python2.6, python3.3, and bring python3.6
- Bring django-2.0 in the matrix as expected failure until we add its
support
2017-09-30 14:37:38 +02:00
Daniel Hahler
6f163727dc tests: fix test_cache_url_value for new django-cache-url 2017-09-29 12:21:12 +02:00
José Antonio Perdiguero
a606003c77 Fix truthy and falsey of values (#162) 2016-10-13 00:00:47 +02:00
Johannes Hoppe
7aaffd3a95 Add EMAIL_USE_SSL to tests (#157)
`dj-email-url` added support for `EMAIL_USE_SSL` in its latest
version.
2016-06-14 18:59:13 +02:00
Johannes Hoppe
9592356572 Move sphinx callback to a separate sphinx submodule 2016-06-13 12:26:52 +02:00
Johannes Hoppe
cd596f6788 Fixes #146 -- Adds multiprocessing support for sphinx 2016-04-05 18:14:20 +02:00
Maxime Rouyrre
7b4df1f6ce Fixed test_database_url_value 2016-03-11 12:01:40 +01:00
Nicolas Delaby
063bf61a16 Drop support of python 2.6, 3.2 and Django < 1.8 2016-01-27 21:08:54 +01:00
John R Dietrick
66bb6a8725 Get skipIf without installing unittest2
In Python 2.7+, unittest *is* unittest2. We prefer this one. But in
Python 2.6, we can get skipIf from django.utils.unittest, provided
Django is 1.8 or older.
2016-01-03 01:21:29 -05:00
John R Dietrick
4fe1c74b35 Add a test which demonstrates the optparse fallback issue 2016-01-03 01:20:29 -05:00
Daniel Hahler
3a1a88bd15 Travis: use Python 3.5 for Python 3 flake8 test 2015-12-17 23:07:40 +01:00
Daniel Hahler
09eae37b23 Fix test_cache_url_value for newer django-cache-url
This fixes the following failure:

    ERROR: test_cache_url_value (tests.test_values.ValueTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "…/django-configurations/configurations/values.py", line 158, in to_python
        return self._caster(value)
      File "…/django-configurations/.tox/py34-dj18/lib/python3.4/site-packages/django_cache_url.py", line 98, in parse
        config['LOCATION'] = "%s:%s:%s" % (url.hostname, url.port, db)
      File "…/pyenv/3.4.3/lib/python3.4/urllib/parse.py", line 156, in port
        port = int(port, 10)
    ValueError: invalid literal for int() with base 10: 'port'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "…/django-configurations/tests/test_values.py", line 415, in test_cache_url_value
        value = CacheURLValue(cache_url)
      File "…/django-configurations/configurations/values.py", line 420, in __init__
        self.default = self.to_python(self.default)
      File "…/django-configurations/configurations/values.py", line 423, in to_python
        value = super(DictBackendMixin, self).to_python(value)
      File "…/django-configurations/configurations/values.py", line 160, in to_python
        raise ValueError(self.message.format(value))
    ValueError: Cannot interpret cache URL value 'redis://user@host:port/1'

    ----------------------------------------------------------------------
    Ran 63 tests in 1.132s

    FAILED (errors=1)
2015-12-17 13:05:03 +01:00
Jannis Leidel
010067b433 Introduced environ_required parameter for Value class. Refs #118. 2015-08-09 14:54:55 +02:00
Miguel Araujo Perez
e09e1e0f42 Added equal operator to values.Value
Allows value setting to work when checking if setting variable is within
a list, i.e: settings.database in ['default', 'other']

Signed-off-by: Jannis Leidel <jannis@leidel.info>
2015-03-16 20:54:17 +01:00
Jannis Leidel
d9f60cfaef Try using the pip caching in the tox config. 2015-03-16 16:59:37 +01:00
Jannis Leidel
6f6930495c Get rid of manage.py for running tests now that we have django-cadmin.
Closes #92.
2015-03-16 15:13:31 +01:00
Jannis Leidel
8f617ad98c Merge pull request #85 from abbottc/master
Add values.TupleOfTuplesValue (plus associated tests and docs)
2015-02-13 22:08:08 +01:00
Jannis Leidel
f7629aa84c Fix test error on Python 3.x. 2015-02-13 21:54:21 +01:00
Jannis Leidel
f35e7e57e0 Add global --configuration option in Django >= 1.8. 2015-02-13 21:47:08 +01:00
Jannis Leidel
9be0c4f700 Fix compatibility between Django versions with regard to the type of some iterable settings such as TEMPLATE_CONTEXT_PROCESSORS. 2015-02-13 21:46:25 +01:00
Jannis Leidel
8be47c0813 Merge remote-tracking branch 'benjaminabel/master' 2015-02-13 18:12:56 +01:00
Jannis Leidel
ea28a6ebd6 Minor fixes for 1.8. 2015-02-13 18:12:02 +01:00
Jannis Leidel
c6b3d05f71 Revert "Use py.test."
This reverts commit 7799241900.
2015-02-13 16:43:55 +01:00
Benjamin ABEL
36a7061a61 Add a test for configuration argument
This test do not use mock, and only searches the `configuration` option in
the help messages.
2015-01-27 22:49:58 +01:00
Christian Abbott
8287ab6f7f Merge remote-tracking branch 'upstream/master' 2015-01-07 03:19:24 -08:00
Christian Abbott
e0a68fdbb6 Rename TupleOfTupleValue to SingleNestedTupleValue; Add SingleNestedListValue and do a DRY refactor of ListValue, TupleValue, and their SingleNested subclasses 2015-01-07 03:08:30 -08:00
Jannis Leidel
7799241900 Use py.test.
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2015-01-06 23:27:00 +01:00
Jannis Leidel
44476bdd1d Merge remote-tracking branch 'hiisi13/master'
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2015-01-06 23:15:08 +01:00
Jannis Leidel
01e3f5837f Merge remote-tracking branch 'joke2k/dot-env'
Signed-off-by: Jannis Leidel <jannis@leidel.info>

Conflicts:
	.gitignore
2015-01-06 22:34:29 +01:00
Mauricio de Abreu Antunes
3f892f9814 Fixed wrong behaviour when assigning BooleanValue
When assigning False to a BooleanValue and reusing it was raising a
ValueError exception because BooleanValue was evaluating False as None.

Thanks to @abbottc for catching this error.
2014-12-27 10:34:40 -02:00
Christian Abbott
c4ba5ca559 Add TupleOfTuplesValue along with associated tests and updated documentation 2014-12-18 07:15:20 -08:00
Jannis Leidel
fb9275744e Merge pull request #78 from slafs/validationmixinfix
fix ValidationMixin instantiation with no default
2014-12-12 16:28:58 +01:00
Sławek Ehlert
8d366fca44 fix ValidationMixin instantiation with no default
with tests. fixes #69
2014-10-30 23:44:48 +01:00
He Weiwei
f8ebb564da fix bug of setup_value func for EmailURLValue 2014-10-08 12:19:35 +08:00
Sven Aßmann
4018f7b42a - add late_binding to value with default False
- this enables a value to load from environment if the env variable name is given at construction time
- cache value of environment value now in property value
- add __new__ to allow a construction of a given type from environment directly. In this case now Value instance is constructed but an instance of the desired type that is covered by the Value implementation. For Value it is str, for DictValue it is dict etc.
- extend tests for this new behavior
- extend test coverage for some other places
2014-05-02 22:51:48 +02:00
joke2k
27eb748d68 refactoring of DotConfiguration 2014-04-17 18:07:33 +02:00
joke2k
5279ae4ace add support to load .env file into os.environ 2014-04-17 16:23:36 +02:00
joke2k
8a8f99ab68 add *.pyc to .gitignore; remove repeated INSTALLED_APPS from test_project.settings; fix check dj-database-url returned None values to empty string 2014-04-17 16:22:31 +02:00
Jannis Leidel
280be2e3e2 Fix database URL test. 2014-04-15 15:36:37 -04:00
Dmitry Kozhedubov
3ae1e368c2 test_cache_url_value fix 2014-03-02 20:41:40 +04:00
Dmitry Kozhedubov
e33eeeb871 Ability to pass keyword args to CastingMixin casters 2014-03-02 13:31:42 +04:00