# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import

from django.conf.urls import url, include
from django.views.generic import RedirectView
from rest_framework.routers import DefaultRouter

from .views import (
    skipped_view, simple_method_view, view_with_django_auth, view_with_drf_auth, SimpleViewSet,
    ViewWithDRFAuth
)


# kept separately, because they are used in tests
url_patterns_with_authentication = [
    url(r'^test-drf-auth/$', view_with_drf_auth, name='endpoint_with_drf_authentication'),
    url(
        r'^test-drf-auth-class/$', ViewWithDRFAuth.as_view(),
        name='endpoint_with_drf_authentication_class'
    ),
    url(r'^test-django-auth/$', view_with_django_auth, name='endpoint_with_django_authentication'),
]

skipped_url_patterns = [
    url(r'^skipped-endpoint/$', skipped_view, name='skipped_endpoint'),
]


urlpatterns = [
    url(r'^$', RedirectView.as_view(url='/', permanent=True), name='root_url'),
    url(r'^test/$', RedirectView.as_view(url='/', permanent=True), name='basic_endpoint'),
    url(r'^test-without-name/$', RedirectView.as_view(url='/', permanent=True)),
    url(
        r'^test-with-parameter/(?P<parameter>[0-9]+)$', simple_method_view,
        name='endpoint_with_parameter'
    ),

    # fixed edge cases
    url(r'^app_urls/', include('tests.app.urls')),

] + url_patterns_with_authentication + skipped_url_patterns

router = DefaultRouter()
router.register(r'view-set', SimpleViewSet, base_name='view-set')

urlpatterns += router.urls

@@ -353,16 +353,332 @@
 Auth%0A)%0A%0A
+try:%0A    django2_url_patterns = %5B%5D%0A    from django.urls import path%0Aexcept ImportError:%0A    # Django %3C 2.0%0A    pass%0Aelse:%0A    django2_url_patterns = %5B%0A        path(%0A            'test-with-new-style-parameter/%3Cint:parameter%3E', simple_method_view,%0A            name='endpoint_with_new_style_parameter'%0A        ),%0A    %5D%0A
 %0A# kept 
@@ -1183,17 +1183,16 @@
 t'),%0A%5D%0A%0A
-%0A
 urlpatte
@@ -1658,16 +1658,16 @@
 ls')),%0A%0A
-
 %5D + url_
@@ -1717,16 +1717,39 @@
 patterns
+ + django2_url_patterns
 %0A%0Arouter

Add to tests URL for Django2 path with parameter