Commit 73b20299 authored by Joost Rijneveld's avatar Joost Rijneveld

Merge branch 'test_django11' into 'master'

Prepare for Django 1.11

See merge request !391
parents 031ef035 366c4541
......@@ -5,7 +5,7 @@ variables:
CI_DEPS: psycopg2
pep8:
image: python:3.4
image: python:3.5
before_script:
- export PIP_CACHE_DIR="pip-cache"
- pip install tox
......@@ -23,21 +23,23 @@ pep8:
- apt-get update
- apt-get install -y ghostscript # required for Thabloid's tests
script:
- tox -e $PYTHON_VERSION
- tox -e ${PYTHON_VERSION}-${DJANGO_VERSION}
- cd website
- coverage report
python34:
python35-django10:
<<: *djangotest
image: python:3.4
image: python:3.5
variables:
PYTHON_VERSION: py34
PYTHON_VERSION: py35
DJANGO_VERSION: django10
python35:
python35-django11:
<<: *djangotest
image: python:3.5
variables:
PYTHON_VERSION: py35
DJANGO_VERSION: django11
docs:
image: python:3.5
......
......@@ -35,9 +35,13 @@ Testing and linting
You may get errors about missing interpreters. That is normal and can be
ignored. If you want to run a specific check, you can do the following:
tox -e flake8 # Runs the flake8 linter
tox -e py34 # runs the tests with python 3.4
tox -e py35 # runs the tests with python 3.5
tox -e flake8 # Runs the flake8 linter
tox -e py34-django10 # runs the tests with python 3.4 and Django 1.10
tox -e py35-django10 # runs the tests with python 3.5 and Django 1.10
tox -e py36-django10 # runs the tests with python 3.6 and Django 1.10
tox -e py34-django11 # runs the tests with python 3.4 and Django 1.11
tox -e py35-django11 # runs the tests with python 3.5 and Django 1.11
tox -e py36-django11 # runs the tests with python 3.6 and Django 1.11
Pillow dependencies
-------------------
......
[tox]
envlist = flake8,py34,py35
envlist = flake8, {py34,py35}-django{10,11}, py36-django11
skipsdist = True
skip_missing_interpreters = True
[testenv]
changedir={toxinidir}/website
commands =
; Copy the env list to make not conflict with the Django version
; specified below
cp {toxinidir}/requirements.txt {envbindir}/reqtemp.txt
sed -i /Django>=.*/d {envbindir}/reqtemp.txt
pip install -r{envbindir}/reqtemp.txt
pipconflictchecker # if this fails, use pipdeptree to debug
python manage.py check
python manage.py templatecheck --project-only
python manage.py makemigrations --no-input --check --dry-run
python -Wall -mcoverage run --branch --source '.' manage.py test
deps =
-r{toxinidir}/requirements.txt
coverage
pip-conflict-checker
django10: django>=1.10,<1.11
django11: django>=1.11b1,<1.12
{env:CI_DEPS:}
passenv = GITLAB_CI
whitelist_externals=
sed
cp
[flake8]
exclude = */migrations/*, */urls.py, .ropeproject
......
......@@ -19,7 +19,7 @@ class Migration(migrations.Migration):
name='Mentorship',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('year', models.IntegerField(validators=django.core.validators.MinValueValidator(1990))),
('year', models.IntegerField(validators=[django.core.validators.MinValueValidator(1990)])),
('member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='members.Member', verbose_name='Member')),
],
),
......
......@@ -7,7 +7,6 @@ from django.contrib.auth.decorators import login_required, permission_required
from django.core.mail import EmailMessage
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.template import Context
from django.template.loader import get_template
from django.utils import timezone, translation
from django.utils.text import slugify
......@@ -249,11 +248,11 @@ def registration(request, event_id, action=None):
subject = _("[THALIA] Notification about your "
"registration for '{}'").format(
event.title)
text_message = text_template.render(Context({
text_message = text_template.render({
'event': event,
'registration': first_waiting,
'member': first_waiting_member
}))
})
waiting_list_notification = EmailMessage(
subject,
......
......@@ -5,7 +5,6 @@ from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import permission_required
from django.core.mail import EmailMultiAlternatives
from django.shortcuts import get_object_or_404, redirect, render
from django.template import Context
from django.template.loader import get_template
from django.utils import translation
from django.utils.translation import activate, get_language_info
......@@ -76,7 +75,7 @@ def admin_send(request, pk):
subject = '[THALIA] ' + newsletter.title
context = Context({
context = {
'newsletter': newsletter,
'agenda_events': (
newsletter.newslettercontent_set
......@@ -86,7 +85,7 @@ def admin_send(request, pk):
'main_partner': main_partner,
'lang_code': language[0],
'request': request
})
}
html_message = html_template.render(context)
text_message = text_template.render(context)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment