Skip to content

Remove no-op __future__ imports, Unicode strings #362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion djng/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def process_request(self, request):

If it's not replaced we want to reverse to url we get a request to url
'/angular/reverse/?djng_url_name=orders&djng_url_kwarg_id=' which
gives a request.GET QueryDict {u'djng_url_name': [u'orders'], u'djng_url_kwarg_id': [u'']}
gives a request.GET QueryDict {'djng_url_name': ['orders'], 'djng_url_kwarg_id': ['']}

In that case we want to ignore the id param and only reverse to url with name 'orders' and no params.
So we ignore args and kwargs that are empty strings.
Expand Down
1 change: 0 additions & 1 deletion examples/server/forms/client_validation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# start tutorial
from django.forms import widgets
from django.core.exceptions import ValidationError
Expand Down
1 change: 0 additions & 1 deletion examples/server/forms/combined_validation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# start tutorial
from django.core.exceptions import ValidationError
from django.forms import widgets
Expand Down
1 change: 0 additions & 1 deletion examples/server/forms/forms_set.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# start tutorial
import re
from django.core.exceptions import ValidationError
Expand Down
1 change: 0 additions & 1 deletion examples/server/forms/image_file_upload.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# start tutorial
from djng.forms import fields, NgModelFormMixin, NgFormValidationMixin
from djng.styling.bootstrap3.forms import Bootstrap3Form
Expand Down
1 change: 0 additions & 1 deletion examples/server/forms/model_scope.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# start tutorial
from django.core.exceptions import ValidationError
from django.forms import widgets
Expand Down
1 change: 0 additions & 1 deletion examples/server/forms/subscribe_form.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# start tutorial
from django.forms import widgets
from django.core.exceptions import ValidationError
Expand Down
1 change: 0 additions & 1 deletion examples/server/models/image_file_upload.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# start tutorial
from django.db import models
from djng.forms import NgModelFormMixin, NgFormValidationMixin
Expand Down
1 change: 0 additions & 1 deletion examples/server/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Django settings for unit test project.
import os

Expand Down
1 change: 0 additions & 1 deletion examples/server/templatetags/tutorial_tags.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django import template
from django.conf import settings
Expand Down
1 change: 0 additions & 1 deletion examples/server/tests/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""Django settings for unit test project."""
import os

Expand Down
2 changes: 0 additions & 2 deletions examples/server/tests/test_fileupload.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import os, json

from django.conf import settings
Expand Down
2 changes: 0 additions & 2 deletions examples/server/tests/test_postprocessor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django import template
from django.test import TestCase
from sekizai.context import SekizaiContext
Expand Down
2 changes: 0 additions & 2 deletions examples/server/tests/test_templatetags.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.test import override_settings, TestCase
from django.test.client import Client

Expand Down
2 changes: 1 addition & 1 deletion examples/server/tests/test_urlresolver_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_get_args_with_encoding(self):
if six.PY3:
args = {'params': 'åäö'}
else:
args = {'param': u'åäö'}
args = {'param': 'åäö'}
data = {
self.url_name_arg: 'home_args',
self.args_prefix: [1, 2, 3],
Expand Down
6 changes: 3 additions & 3 deletions examples/server/tests/test_urlresolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def test_get_current_remote_methods(self):
def test_get_all_remote_methods(self):
remote_methods = get_all_remote_methods()
expected = {
'urlresolvertags': {'blah': {u'url': '/url_resolvers/', u'headers': {u'DjNg-Remote-Method': 'blah'}, u'method': 'auto'}},
'urlresolvertags': {'blah': {'url': '/url_resolvers/', 'headers': {'DjNg-Remote-Method': 'blah'}, 'method': 'auto'}},
'submethods': {
'app': {'foo': {u'url': '/sub_methods/sub/app/', u'headers': {u'DjNg-Remote-Method': 'foo'}, u'method': 'auto'},
'bar': {u'url': '/sub_methods/sub/app/', u'headers': {u'DjNg-Remote-Method': 'bar'}, u'method': 'auto'}},
'app': {'foo': {'url': '/sub_methods/sub/app/', 'headers': {'DjNg-Remote-Method': 'foo'}, 'method': 'auto'},
'bar': {'url': '/sub_methods/sub/app/', 'headers': {'DjNg-Remote-Method': 'bar'}, 'method': 'auto'}},
},
}
self.assertDictEqual(remote_methods, expected)
1 change: 0 additions & 1 deletion examples/server/views/classic_subscribe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from server.forms.subscribe_form import SubscribeForm
# start tutorial
from django.views.generic.edit import FormView
Expand Down
1 change: 0 additions & 1 deletion examples/server/views/forms_set.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from server.forms.forms_set import SubscribeForm, AddressForm
# start tutorial
import json
Expand Down