update urls.pyes to use path() and add some tests

This commit is contained in:
2023-02-16 00:04:25 -06:00
parent 95396802de
commit 337e4db650
11 changed files with 125 additions and 43 deletions

View File

@@ -1,5 +1,4 @@
"""URL patterns for the facts web views."""
from django.conf.urls import url
from django.urls import path
from facts.views import factcategory_detail, index, rpc_get_facts, rpc_get_random_fact
@@ -8,6 +7,6 @@ urlpatterns = [
path('rpc/<category>/', rpc_get_facts, name='weather_rpc_get_facts'),
path('rpc/<category>/random/', rpc_get_random_fact, name='weather_rpc_get_random_fact'),
url(r'^$', index, name='facts_index'),
url(r'^(?P<factcategory_name>.+)/$', factcategory_detail, name='facts_factcategory_detail'),
path('', index, name='facts_index'),
path('<factcategory_name>/', factcategory_detail, name='facts_factcategory_detail'),
]