diff --git a/.travis.yml b/.travis.yml index a8f475183c755deceac19f539c087aec88b8f736..113407cc91cbf562d90f65534574f421e5cdeea9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,11 +8,15 @@ python: - "3.4" env: - - DJANGO="django==1.11.9" + - DJANGO="django==3.1.3" + - DJANGO="django==3.0.11" + - DJANGO="django==2.2.17" + - DJANGO="django==2.1.15" + - DJANGO="django==2.0.13" + - DJANGO="django==1.11.29" - DJANGO="django==1.10.8" - DJANGO="django==1.9.13" - - DJANGO="django==1.8.18" - - DJANGO="django==2.0.1" + - DJANGO="django==1.8.19" install: - pip install $DJANGO diff --git a/README.rst b/README.rst index 9155a34b1681a7f4eba52103200d41c367edbdd9..5b6c265d853462ee53bb9b05664ad93a0d078119 100644 --- a/README.rst +++ b/README.rst @@ -13,8 +13,8 @@ dictionaries to generate menu items Features: --------- -- Tested support to Python 3.4, 3.5, 3.6 -- Tested support to Django 1.8, 1.9, 1.10, 1.11, 2.0 +- Tested support to Python 3.4, 3.5, 3.6, 3.7, 3.8 +- Tested support to Django 1.8, 1.9, 1.10, 1.11, 2.0, 2.2, 3.0, 3.1 - No database - Support unlimited menus - Icons support diff --git a/menu_generator/tests/test_menu.py b/menu_generator/tests/test_menu.py index 7128d1306cddf2b0eda483a1f923b7ce6ff09936..c25a89cc6b66a84f18290e5039b9f30bdb7a3844 100755 --- a/menu_generator/tests/test_menu.py +++ b/menu_generator/tests/test_menu.py @@ -267,7 +267,7 @@ class MenuTestCase(TestCase): self.request.path = "/persons/1/" self.menu.save_user_state(self.request) list_dict = [ - { + { "name": "parent1", "url": "/user/account/", "related_urls": ["/persons/", "/groups/"], @@ -283,7 +283,7 @@ class MenuTestCase(TestCase): self.request.path = "/persons/1/" self.menu.save_user_state(self.request) list_dict = [ - { + { "name": "parent1", "url": "/user/account/", "submenu": [ @@ -305,4 +305,4 @@ class MenuTestCase(TestCase): self.assertEqual(len(nav), 1) self.assertEqual(nav[0]["selected"], True) self.assertEqual(nav[0]["submenu"][0]["selected"], True) - self.assertEqual(nav[0]["submenu"][1]["selected"], False) \ No newline at end of file + self.assertEqual(nav[0]["submenu"][1]["selected"], False) diff --git a/menu_generator/utils.py b/menu_generator/utils.py index 30d0f71d6f02dae51fbddfc8ded95a5d651bf1da..e67cde828363e136354f7b550a995c663bd21b96 100755 --- a/menu_generator/utils.py +++ b/menu_generator/utils.py @@ -9,6 +9,7 @@ if django.VERSION >= (1, 10): # pragma: no cover else: from django.core.urlresolvers import reverse, NoReverseMatch + def get_callable(func_or_path): """ Receives a dotted path or a callable, Returns a callable or None @@ -50,4 +51,4 @@ def parse_url(url): final_url = reverse(**url) if type(url) is dict else reverse(url) except NoReverseMatch: final_url = url - return final_url \ No newline at end of file + return final_url