diff --git a/.travis.yml b/.travis.yml index f496481..873d9f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,80 +1,27 @@ language: python python: - - "2.6" - "2.7" - - "3.3" - "3.4" - "3.5" - "3.6" env: - - DJANGO_VERSION='Django>=1.4,<1.5' - - DJANGO_VERSION='Django>=1.5,<1.6' - - DJANGO_VERSION='Django>=1.6,<1.7' - - DJANGO_VERSION='Django>=1.7,<1.8' - - 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='Django>=2.0,<2.1' + - DJANGO_VERSION='Django>=2.1,<2.2' - DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz' matrix: exclude: - - python: "2.6" - env: DJANGO_VERSION='Django>=1.7,<1.8' - - python: "2.6" - env: DJANGO_VERSION='Django>=1.8,<1.9' - - python: "2.6" - env: DJANGO_VERSION='Django>=1.9,<1.10' - - 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='Django>=2.0,<2.1' + - python: "2.7" + env: DJANGO_VERSION='Django>=2.1,<2.2' - 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' - - python: "3.3" - env: DJANGO_VERSION='Django>=1.5,<1.6' - - python: "3.3" - 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" + - python: "3.4" + env: DJANGO_VERSION='Django>=2.1,<2.2' + - python: "2.7" env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz' - - python: "3.4" - env: DJANGO_VERSION='Django>=1.4,<1.5' - - python: "3.4" - 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" - env: DJANGO_VERSION='Django>=1.5,<1.6' - - python: "3.5" - env: DJANGO_VERSION='Django>=1.6,<1.7' - - python: "3.5" - env: DJANGO_VERSION='Django>=1.7,<1.8' - - python: "3.6" - env: DJANGO_VERSION='Django>=1.4,<1.5' - - python: "3.6" - env: DJANGO_VERSION='Django>=1.5,<1.6' - - python: "3.6" - env: DJANGO_VERSION='Django>=1.6,<1.7' - - python: "3.6" - env: DJANGO_VERSION='Django>=1.7,<1.8' - - python: "3.6" - env: DJANGO_VERSION='Django>=1.8,<1.9' - - python: "3.6" - env: DJANGO_VERSION='Django>=1.9,<1.10' - - python: "3.6" - env: DJANGO_VERSION='Django>=1.10,<1.11' allow_failures: - env: DJANGO_VERSION='https://github.com/django/django/archive/master.tar.gz' diff --git a/README.rst b/README.rst index f1daad0..628dbad 100644 --- a/README.rst +++ b/README.rst @@ -14,9 +14,9 @@ A new model field and form field. With this you can get a multiple select from a This egg is inspired by this `snippet `_. -Supported Python versions: 2.6, 2.7, 3.3+ +Supported Python versions: 2.7, 3.4+ -Supported Django versions: 1.4-1.11+ +Supported Django versions: 1.11-2.0+ Installation ============ diff --git a/example/app/test_msf.py b/example/app/test_msf.py index b5e3932..dc057ee 100644 --- a/example/app/test_msf.py +++ b/example/app/test_msf.py @@ -32,12 +32,8 @@ else: u = str -if VERSION < (1, 9): - def get_field(model, name): - return model._meta.get_field_by_name(name)[0] -else: - def get_field(model, name): - return model._meta.get_field(name) +def get_field(model, name): + return model._meta.get_field(name) class MultiSelectTestCase(TestCase): @@ -77,12 +73,8 @@ class MultiSelectTestCase(TestCase): # call Field.from_db_field, it simply returns a Python representation # of the data in the database (which in our case is a string of # comma-separated values). The bug was fixed in Django 1.8+. - if VERSION >= (1, 6) and VERSION < (1, 8): - self.assertStringEqual(tag_list_list, [u('sex,work,happy')]) - self.assertStringEqual(categories_list_list, [u('1,3,5')]) - else: - self.assertListEqual(tag_list_list, [['sex', 'work', 'happy']]) - self.assertListEqual(categories_list_list, [['1', '3', '5']]) + self.assertListEqual(tag_list_list, [['sex', 'work', 'happy']]) + self.assertListEqual(categories_list_list, [['1', '3', '5']]) def test_form(self): form_class = modelform_factory(Book, fields=('title', 'tags', 'categories')) @@ -139,7 +131,7 @@ class MultiSelectTestCase(TestCase): self.assertEqual(len(form_class.base_fields), 1) form = form_class(initial={'published_in': ['BC', 'AK']}) - expected_html = u("""