Merge lp:~michael.nelson/django-configglue/default_wsgi_application_none into lp:django-configglue

Proposed by Michael Nelson
Status: Merged
Approved by: Ricardo Kirkner
Approved revision: 76
Merged at revision: 74
Proposed branch: lp:~michael.nelson/django-configglue/default_wsgi_application_none
Merge into: lp:django-configglue
Diff against target: 38 lines (+11/-2)
2 files modified
django_configglue/schema.py (+2/-1)
django_configglue/tests/test_schema.py (+9/-1)
To merge this branch: bzr merge lp:~michael.nelson/django-configglue/default_wsgi_application_none
Reviewer Review Type Date Requested Status
Ricardo Kirkner Approve
Review via email: mp+160289@code.launchpad.net

Commit message

Default value for Django 1.4's wsgi_application is None.

Description of the change

Ensure the default value for Django 1.4's wsgi_application is None, rather than ''.

See the bug for more details.

`python setup.py test`

To post a comment you must log in.
Revision history for this message
Ricardo Kirkner (ricardokirkner) wrote :

look good, except that a nullable string option should have null=True in the constructor to allow for the None value. If null=True is used, the default value will be None, so no need to pass that in explicitely.

review: Needs Fixing
76. By Michael Nelson

REFACTOR: switch from default=None to null=True which implies the former.

Revision history for this message
Michael Nelson (michael.nelson) wrote :

Thanks. Fixed in r76.

Revision history for this message
Ricardo Kirkner (ricardokirkner) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'django_configglue/schema.py'
2--- django_configglue/schema.py 2013-04-03 12:35:25 +0000
3+++ django_configglue/schema.py 2013-04-29 06:39:24 +0000
4@@ -1163,7 +1163,8 @@
5
6 wsgi_application = StringOption(
7 help="The full Python path of the WSGI application object"
8- "that Django's built-in servers (e.g. runserver) will use.")
9+ "that Django's built-in servers (e.g. runserver) will use.",
10+ null=True)
11
12 csrf_cookie_secure = BoolOption(
13 default=False,
14
15=== modified file 'django_configglue/tests/test_schema.py'
16--- django_configglue/tests/test_schema.py 2012-01-10 12:16:57 +0000
17+++ django_configglue/tests/test_schema.py 2013-04-29 06:39:24 +0000
18@@ -4,7 +4,10 @@
19
20 from configglue.parser import SchemaConfigParser
21
22-from django_configglue.schema import BaseDjangoSchema
23+from django_configglue.schema import (
24+ BaseDjangoSchema,
25+ Django14Schema,
26+)
27
28
29 class DjangoSchemaTestCase(TestCase):
30@@ -19,3 +22,8 @@
31 value = parser.values()['django']['time_zone']
32 self.assertEqual(value, None)
33
34+ def test_default_wsgi_application_is_none(self):
35+ parser = SchemaConfigParser(Django14Schema())
36+
37+ value = parser.values()['django']['wsgi_application']
38+ self.assertIsNone(value)

Subscribers

People subscribed via source and target branches