-
Notifications
You must be signed in to change notification settings - Fork 31
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
🌟 Add support for Django2.0 #121
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
language: python | ||
sudo: false | ||
|
||
python: | ||
- "2.7" | ||
- "3.4" | ||
- "3.5" | ||
- "3.6" | ||
- 2.7 | ||
- 3.4 | ||
- 3.5 | ||
- 3.6 | ||
|
||
env: | ||
- DJANGO_VERSION=1.9.11 | ||
- DJANGO_VERSION=1.10.5 | ||
- DJANGO_VERSION=1.11.2 | ||
- DJANGO_VERSION=1.11.14 | ||
- DJANGO_VERSION=2.0.7 | ||
|
||
matrix: | ||
exclude: | ||
- python: 2.7 | ||
env: DJANGO_VERSION=2.0.7 | ||
|
||
install: | ||
- pip install -q -rrequirements/base.txt | ||
- pip install -q -rrequirements/tests.txt | ||
- pip install -q -r requirements/base.txt | ||
- pip install -q -r requirements/tests.txt | ||
- pip install -q django==$DJANGO_VERSION | ||
- pip install coveralls | ||
|
||
before_script: | ||
- createdb -E UTF-8 dash -U postgres -O $USER | ||
|
||
script: | ||
- coverage run manage.py test --settings=test_runner.settings_travis --verbosity=2 --noinput | ||
- flake8 | ||
|
||
after_success: | ||
- coveralls |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
celery | ||
django>=1.9,<2.0 | ||
django>=1.11,<2.1 | ||
django_compressor | ||
pytz | ||
redis | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from __future__ import unicode_literals | ||
|
||
__version__ = '1.11.9' | ||
__version__ = '2.0.0' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ def process_response(self, request, response): | |
|
||
|
||
class ProfileMiddleware(MiddlewareMixin): | ||
def __init__(self): | ||
def __init__(self, get_response=None): | ||
pass | ||
|
||
def process_view(self, request, view, *args, **kwargs): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This middleware should be updated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Never mind |
||
|
@@ -69,7 +69,7 @@ def process_view(self, request, view, *args, **kwargs): | |
return None | ||
|
||
|
||
class TimezoneMiddleware(object): | ||
class TimezoneMiddleware(MiddlewareMixin): | ||
def process_request(self, request): | ||
user_tz = getattr(settings, 'USER_TIME_ZONE', None) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
from django.contrib.auth.models import User, Group | ||
from django.core import mail | ||
from django.core.files.uploadedfile import SimpleUploadedFile | ||
from django.core.urlresolvers import reverse | ||
from django.urls import reverse | ||
from django.test import TestCase | ||
from django.test.client import Client | ||
from django.test.utils import override_settings | ||
|
@@ -904,7 +904,7 @@ def test_lockout(self): | |
# try to log in four times | ||
for i in range(4): | ||
response = self.client.post(login_url, post_data) | ||
self.assertFalse(response.context['user'].is_authenticated()) | ||
self.assertFalse(response.context['user'].is_authenticated) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so this was a method in Django 1.x but a field in Django 2.x? Problem with this test is that if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok I just poked around the Django src and it seems |
||
|
||
# on the fifth failed login we get redirected | ||
response = self.client.post(login_url, post_data) | ||
|
@@ -1050,14 +1050,14 @@ def doLockout(self): | |
|
||
# on the fifth time it should fail | ||
response = self.client.post(reverse('users.user_login'), post_data, follow=True) | ||
self.assertFalse(response.context['user'].is_authenticated()) | ||
self.assertFalse(response.context['user'].is_authenticated) | ||
content = response.content.decode("utf-8") | ||
self.assertEqual(content.find(reverse('users.user_forget')), -1) | ||
|
||
# even with right password, no dice | ||
post_data = dict(username='plain', password='plain') | ||
response = self.client.post(reverse('users.user_login'), post_data, follow=True) | ||
self.assertFalse(response.context['user'].is_authenticated()) | ||
self.assertFalse(response.context['user'].is_authenticated) | ||
content = response.content.decode("utf-8") | ||
self.assertEqual(content.find(reverse('users.user_forget')), -1) | ||
|
||
|
@@ -1079,7 +1079,7 @@ def testNoRecovery(self): | |
|
||
# should now be able to log in | ||
response = self.client.post(reverse('users.user_login'), post_data, follow=True) | ||
self.assertTrue(response.context['user'].is_authenticated()) | ||
self.assertTrue(response.context['user'].is_authenticated) | ||
|
||
def testNoRecoveryNoTimeout(self): | ||
with self.settings(USER_ALLOW_EMAIL_RECOVERY=False, USER_LOCKOUT_TIMEOUT=-1): | ||
|
@@ -1124,7 +1124,7 @@ def testNoRecoveryNoTimeout(self): | |
|
||
post_data = dict(username='plain', password='Password1') | ||
response = self.client.post(reverse('users.user_login'), post_data, follow=True) | ||
self.assertTrue(response.context['user'].is_authenticated()) | ||
self.assertTrue(response.context['user'].is_authenticated) | ||
|
||
|
||
class PasswordExpirationTestCase(TestCase): | ||
|
@@ -1146,7 +1146,7 @@ def testNoExpiration(self): | |
self.client.logout() | ||
post_data = dict(username='plain', password='Password1 ') | ||
response = self.client.post(reverse('users.user_login'), post_data, follow=True) | ||
self.assertTrue(response.context['user'].is_authenticated()) | ||
self.assertTrue(response.context['user'].is_authenticated) | ||
|
||
# we shouldn't be on a page asking us for a new password | ||
self.assertFalse('form' in response.context) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MiddlewareMixin is no longer needed