Commit 2815dca5 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

Add Python 3.6 support

With all the prep work that there are three things left:

1. Adding the py36 to tox.ini.

2. Dealing with differences in how emails are assembled with
   the email module.

3. Including the generated migration.

Point #2 is handled rather naively by checking python version and using
the correct reference checksum.
Signed-off-by: Arkadiusz Hiler's avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent f6b5dd24
dist: trusty
language: python
python:
- 2.7
- 3.6
cache: pip
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-20 22:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('patchwork', '0027_auto_20180116_0044'),
]
operations = [
migrations.AlterField(
model_name='emailconfirmation',
name='type',
field=models.CharField(choices=[('userperson', 'User-Person association'), ('registration', 'Registration'), ('optout', 'Email opt-out')], max_length=20),
),
migrations.AlterField(
model_name='project',
name='subject_prefix_tags',
field=models.CharField(blank=True, help_text='Comma separated list of tags', max_length=255),
),
migrations.AlterField(
model_name='series',
name='name',
field=models.CharField(default='Series without cover letter', max_length=200),
),
migrations.AlterField(
model_name='seriesrevision',
name='state',
field=models.SmallIntegerField(choices=[(0, 'incomplete'), (1, 'initial'), (2, 'in progress'), (3, 'done')], default=0),
),
migrations.AlterField(
model_name='seriesrevision',
name='test_state',
field=models.SmallIntegerField(blank=True, choices=[(0, 'pending'), (1, 'info'), (2, 'success'), (3, 'warning'), (4, 'failure')], null=True),
),
migrations.AlterField(
model_name='tag',
name='abbrev',
field=models.CharField(help_text='Short (one-or-two letter) abbreviation for the tag, used in table column headers', max_length=2, unique=True),
),
migrations.AlterField(
model_name='tag',
name='pattern',
field=models.CharField(help_text='A simple regex to match the tag in the content of a message. Will be used with MULTILINE and IGNORECASE flags. eg. ^Acked-by:', max_length=50),
),
migrations.AlterField(
model_name='test',
name='mail_cc_list',
field=models.CharField(blank=True, help_text='Comma separated list of emails', max_length=255, null=True),
),
migrations.AlterField(
model_name='test',
name='mail_condition',
field=models.SmallIntegerField(choices=[(0, 'always'), (1, 'on warning/failure'), (2, 'on failure')], default=0),
),
migrations.AlterField(
model_name='test',
name='mail_recipient',
field=models.SmallIntegerField(choices=[(0, 'none'), (1, 'submitter'), (2, 'mailing list'), (3, 'recipient list')], default=0),
),
migrations.AlterField(
model_name='test',
name='mail_to_list',
field=models.CharField(blank=True, help_text='Comma separated list of emails', max_length=255, null=True),
),
migrations.AlterField(
model_name='testresult',
name='state',
field=models.SmallIntegerField(choices=[(0, 'pending'), (1, 'info'), (2, 'success'), (3, 'warning'), (4, 'failure')]),
),
migrations.AlterField(
model_name='userprofile',
name='patches_per_page',
field=models.PositiveIntegerField(default=100, help_text='Number of patches to display per page'),
),
migrations.AlterField(
model_name='userprofile',
name='send_email',
field=models.BooleanField(default=False, help_text='Selecting this option allows patchwork to send email on your behalf'),
),
]
......@@ -29,6 +29,7 @@ import time
import dateutil.parser as dateparse
from django.core import mail
from django.test.utils import override_settings
from django.utils import six
import patchwork.tests.test_series as test_series
from patchwork.tests.test_user import TestUser
......@@ -240,9 +241,15 @@ class APITest(APITestBase):
i += 1
def testSeriesMbox(self):
self.check_mbox("/series/%s/revisions/1/mbox/" % self.series.pk,
'for_each_-intel_-crtc-v2.mbox',
'42e2b2c9eeccf912c998be41683f50d7')
# XXX: since Python 3 email module wrap header lines differently
if six.PY3:
self.check_mbox("/series/%s/revisions/1/mbox/" % self.series.pk,
'for_each_-intel_-crtc-v2.mbox',
'6d59b59dbf751064408249e18401275f')
else:
self.check_mbox("/series/%s/revisions/1/mbox/" % self.series.pk,
'for_each_-intel_-crtc-v2.mbox',
'42e2b2c9eeccf912c998be41683f50d7')
def _check_mbox_link(self, url, n):
response = self.client.get('/api/1.0' + url, {'link': 'Patchwork'})
......
[tox]
minversion = 1.6
envlist = {py27}-django{18,111}, pep8
envlist = py{27,36}-django{18,111}, pep8
skipsdist = True
[testenv]
......
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