TT#43813 fix RemovedInDjango20Warning issues

This will help us when jumping to Django 2+

> /code/repoapi/urls.py:93: RemovedInDjango20Warning: Specifying a namespace in
>  django.conf.urls.include() without providing an app_name is deprecated. Set
>  the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns
>  and app_name instead.
>    url(r"^build/", include("build.urls", namespace="build")),

* py-test: set norecursedirs due to 'build' is in the default
  so build app was not included in the test
* py-test: raise errors if warnings from Django are detected
  from repoapi

Change-Id: Iab74024a435c1d7851cfe5a51f0ae54a044791a3
changes/93/38693/1
Victor Seva 7 years ago
parent 69557f8e16
commit 44b0cdc640

@ -16,6 +16,7 @@ from django.conf.urls import url
from . import views
app_name = "build"
urlpatterns = [
url(r"^$", views.BuildReleaseList.as_view(), name="list"),
url(

@ -16,6 +16,7 @@ from django.conf.urls import url
from . import views
app_name = "panel"
urlpatterns = [
url(r"^$", views.index, name="index"),
url(

@ -18,6 +18,7 @@ from .views import build
from .views import docker
from .views import Index
app_name = "release_dashboard"
urlpatterns = [
url(r"^$", Index.as_view(), name="index"),
url(r"^old/$", Index.as_view(old_links=True), name="index_old"),

@ -1,12 +1,15 @@
# Copyright (C) 2015 The Sipwise Team - http://sipwise.com
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
import object_tools
@ -87,23 +90,20 @@ api_patterns = [
docker.DockerTagDetail.as_view(),
name="dockertag-detail",
),
url(r"^build/", include("build.urls", namespace="build")),
url(r"^build/", include("build.urls")),
]
api_patterns = format_suffix_patterns(api_patterns)
urlpatterns = [
url(r"^object-tools/", include(object_tools.tools.urls)),
url(r"^admin/", include(admin.site.urls)),
url(r"^object-tools/", object_tools.tools.urls),
url(r"^admin/", admin.site.urls),
url(r"^", include(api_patterns)),
url(
r"^api-auth/",
include("rest_framework.urls", namespace="rest_framework"),
),
url(r"^docs/", views.schema_view),
url(r"^panel/", include("panel.urls", namespace="panel")),
url(
r"^release_panel/",
include("release_dashboard.urls", namespace="release_dashboard"),
),
url(r"^panel/", include("panel.urls")),
url(r"^release_panel/", include("release_dashboard.urls"),),
]

@ -2,6 +2,12 @@
DJANGO_SETTINGS_MODULE = repoapi.settings.test
# -- recommended but optional:
python_files = tests.py test_*.py *_tests.py
# build dir is in the default
# https://docs.pytest.org/en/latest/reference.html#confval-norecursedirs
norecursedirs = .git
# make warnings an error if is from repoapi
filterwarnings =
error::django.utils.deprecation.RemovedInNextVersionWarning:repoapi[.*]
[coverage:run]
data_file = ${RESULTS}/.coverage

Loading…
Cancel
Save