diff --git a/.travis.yml b/.travis.yml index 1e87fa6..a46d95c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ env: - DJANGO_VERSION='Django>=1.8,<1.9' - DJANGO_VERSION='Django>=1.9,<1.10' - DJANGO_VERSION='Django>=1.10,<1.11' + - DJANGO_VERSION='Django>=1.11,<2.0' - DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz' matrix: exclude: @@ -26,6 +27,10 @@ matrix: - python: "2.6" env: DJANGO_VERSION='Django>=1.10,<1.11' - python: "2.6" + env: DJANGO_VERSION='Django>=1.11,<2.0' + - python: "2.6" + env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz' + - python: "2.7" env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz' - python: "3.3" env: DJANGO_VERSION='Django>=1.4,<1.5' @@ -35,6 +40,8 @@ matrix: env: DJANGO_VERSION='Django>=1.9,<1.10' - python: "3.3" env: DJANGO_VERSION='Django>=1.10,<1.11' + - python: "3.3" + env: DJANGO_VERSION='Django>=1.11,<2.0' - python: "3.3" env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz' - python: "3.4" @@ -43,6 +50,8 @@ matrix: env: DJANGO_VERSION='Django>=1.5,<1.6' - python: "3.4" env: DJANGO_VERSION='Django>=1.6,<1.7' + - python: "3.4" + env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz' - python: "3.5" env: DJANGO_VERSION='Django>=1.4,<1.5' - python: "3.5" diff --git a/example/app/test_msf.py b/example/app/test_msf.py index 72481cf..b5e3932 100644 --- a/example/app/test_msf.py +++ b/example/app/test_msf.py @@ -144,13 +144,22 @@ class MultiSelectTestCase(TestCase): """
  • USA - States
  • """) + actual_html = form.as_p() - if VERSION < (1, 6) or VERSION >= (1, 7): + if (1, 11) <= VERSION < (2, 0): + # Django 1.11+ does not assign 'for' attributes on labels if they + # are group labels + expected_html = expected_html.replace('label for="id_published_in_0"', 'label') + + if VERSION < (1, 6): # Django 1.6 renders the Python repr() for each group (eg: tuples # with HTML entities), so we skip the test for that version self.assertEqual(expected_html.replace('\n', ''), actual_html.replace('\n', '')) + if VERSION >= (1, 7): + self.assertHTMLEqual(expected_html, actual_html) + class MultiSelectUtilsTestCase(TestCase): def test_get_max_length_max_length_is_not_none(self):