Commit 5e39823d authored by Aurélien Bompard's avatar Aurélien Bompard

Add support for Django 1.11

parent 059c07a9
......@@ -35,8 +35,13 @@ setup(
include_package_data=True,
install_requires=[
'Django>=1.8',
'Django<1.11',
'Django<1.12',
'django-mailman3',
'mailmanclient',
],
tests_require=[
"mock",
"vcrpy",
"beautifulsoup4",
],
)
......@@ -183,6 +183,19 @@ interactions:
content-length: ['140']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/system/pipelines
response:
body: {string: !!python/unicode '{"http_etag": "\"ff8a7af97caf24e6ca24c5baed447ff532bd1b4f\"",
"pipelines": ["default-owner-pipeline", "default-posting-pipeline", "virgin"]}'}
headers:
content-length: ['140']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
......@@ -323,6 +336,19 @@ interactions:
content-length: ['140']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/system/pipelines
response:
body: {string: !!python/unicode '{"http_etag": "\"ff8a7af97caf24e6ca24c5baed447ff532bd1b4f\"",
"pipelines": ["default-owner-pipeline", "default-posting-pipeline", "virgin"]}'}
headers:
content-length: ['140']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
......
......@@ -184,19 +184,6 @@ interactions:
content-length: ['1937']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/system/pipelines
response:
body: {string: !!python/unicode '{"http_etag": "\"ff8a7af97caf24e6ca24c5baed447ff532bd1b4f\"",
"pipelines": ["default-owner-pipeline", "default-posting-pipeline", "virgin"]}'}
headers:
content-length: ['140']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
......@@ -404,51 +391,12 @@ interactions:
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
uri: http://localhost:9001/3.0/system/pipelines
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
body: {string: !!python/unicode '{"http_etag": "\"ff8a7af97caf24e6ca24c5baed447ff532bd1b4f\"",
"pipelines": ["default-owner-pipeline", "default-posting-pipeline", "virgin"]}'}
headers:
content-length: ['119']
content-length: ['140']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
......@@ -456,12 +404,12 @@ interactions:
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
uri: http://localhost:9001/3.0/system/pipelines
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
body: {string: !!python/unicode '{"http_etag": "\"ff8a7af97caf24e6ca24c5baed447ff532bd1b4f\"",
"pipelines": ["default-owner-pipeline", "default-posting-pipeline", "virgin"]}'}
headers:
content-length: ['119']
content-length: ['140']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
......@@ -868,6 +816,71 @@ interactions:
content-length: ['1937']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
......
......@@ -134,19 +134,6 @@ interactions:
content-length: ['1937']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/system/pipelines
response:
body: {string: !!python/unicode '{"http_etag": "\"ff8a7af97caf24e6ca24c5baed447ff532bd1b4f\"",
"pipelines": ["default-owner-pipeline", "default-posting-pipeline", "virgin"]}'}
headers:
content-length: ['140']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
......@@ -254,51 +241,12 @@ interactions:
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
uri: http://localhost:9001/3.0/system/pipelines
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
body: {string: !!python/unicode '{"http_etag": "\"ff8a7af97caf24e6ca24c5baed447ff532bd1b4f\"",
"pipelines": ["default-owner-pipeline", "default-posting-pipeline", "virgin"]}'}
headers:
content-length: ['119']
content-length: ['140']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
......@@ -306,12 +254,12 @@ interactions:
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
uri: http://localhost:9001/3.0/system/pipelines
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
body: {string: !!python/unicode '{"http_etag": "\"ff8a7af97caf24e6ca24c5baed447ff532bd1b4f\"",
"pipelines": ["default-owner-pipeline", "default-posting-pipeline", "virgin"]}'}
headers:
content-length: ['119']
content-length: ['140']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
......@@ -518,6 +466,71 @@ interactions:
content-length: ['1937']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
accept-encoding: ['gzip, deflate']
method: !!python/unicode 'GET'
uri: http://localhost:9001/3.0/lists/foo.example.com/archivers
response:
body: {string: !!python/unicode '{"http_etag": "\"3dbbbaad592a043938314db0e5249a1ca71d0dc6\"",
"mail-archive": true, "mhonarc": true, "prototype": true}'}
headers:
content-length: ['119']
content-type: [application/json; charset=UTF-8]
status: {code: 200, message: OK}
- request:
body: null
headers:
......
......@@ -20,6 +20,7 @@
from __future__ import absolute_import, print_function, unicode_literals
from allauth.account.models import EmailAddress
from bs4 import BeautifulSoup
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
......@@ -62,12 +63,16 @@ class ListBansTest(ViewTestCase):
response = self.client.get(self.url)
self.assertEqual(response.status_code, 200)
self.assertTrue('addban_form' in response.context)
self.assertContains(
response, '<input class="form-control" id="id_email" '
'name="email" type="text" ')
self.assertContains(
response, '<button class="btn btn-primary" type="submit" '
'name="add">Ban email</button>')
soup = BeautifulSoup(response.content, "html.parser")
tag_input = soup.find("input", {
"class": "form-control", "id": "id_email",
"name": "email", "type": "text",
})
self.assertIsNotNone(tag_input)
tag_button = soup.find("button", {
"class": "btn btn-primary", "name": "add", "type": "submit",
})
self.assertIsNotNone(tag_button)
def test_context_contains_delete_forms(self):
banned = ['banned{}@example.com'.format(i) for i in range(1, 10)]
......@@ -75,14 +80,15 @@ class ListBansTest(ViewTestCase):
self.m_list.bans.add(ban)
response = self.client.get(self.url)
self.assertEqual(response.status_code, 200)
soup = BeautifulSoup(response.content, "html.parser")
for ban in banned:
self.assertContains(
response,
'<input type="hidden" name="email" value="%s" />' % ban)
self.assertContains(
response,
'<button class="btn btn-danger btn-xs" type="submit" name="del"',
count=9)
self.assertIsNotNone(soup.find("input", {
"name": "email", "type": "hidden", "value": ban,
}))
self.assertEqual(len(soup.find_all("button", {
"class": "btn btn-danger btn-xs",
"name": "del", "type": "submit",
})), 9)
def test_add_ban(self):
response = self.client.post(self.url, {
......
......@@ -20,6 +20,7 @@
from __future__ import absolute_import, print_function, unicode_literals
from allauth.account.models import EmailAddress
from bs4 import BeautifulSoup
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
......@@ -91,7 +92,11 @@ class ListHeaderMatchesTest(ViewTestCase):
'action': u'discard'}])
self.assertContains(response, 'testheader')
self.assertContains(response, 'testpattern')
self.assertContains(response, 'value="discard" selected="selected"')
soup = BeautifulSoup(response.content, "html.parser")
tag_form = soup.find("select", {"name": "form-0-action"})
self.assertIsNotNone(tag_form)
tag_option = tag_form.find("option", value="discard", selected=True)
self.assertIsNotNone(tag_option)
# the new header match subform should not have ORDER or DELETE fields
self.assertNotContains(response, 'form-1-ORDER')
self.assertNotContains(response, 'form-1-DELETE')
......
[tox]
envlist = py27-django{18,19,110},pep8
envlist = py27-django{18,19,110,111},pep8
[testenv]
......@@ -7,6 +7,7 @@ usedevelop = True
deps =
mock
vcrpy
beautifulsoup4
coverage: coverage
head: git+https://gitlab.com/mailman/mailmanclient.git
head: git+https://gitlab.com/mailman/django-mailman3.git
......@@ -15,6 +16,7 @@ deps =
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11
django111: Django>=1.11,<1.12
django-latest: https://github.com/django/django/archive/master.tar.gz
commands =
python example_project/manage.py test --settings=test_settings {posargs:postorius}
......
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