Commit fdededa0 authored by Dan Mark Restoles's avatar Dan Mark Restoles

first test passed

parent 37b82c42
from django.test import TestCase
from django.urls import resolve
from .views import HeroesView, CloudView, JesterView, SunfloweyView
# Create your tests here.
class HeroesPageTest(TestCase):
def test_root_url_resolves_to_heroes_page_view(self):
found = resolve('/heroes/')
self.assertEqual(found.func.__name__, HeroesView.as_view().__name__)
\ No newline at end of file
from django.conf.urls import url
from .views import HeroesView, HeroView
from .views import HeroesView, CloudView, JesterView, SunfloweyView
urlpatterns = [
url(r'/heroes', HeroesView.as_view(), name='Heroes'),
url(r'^heroes/', HeroesView.as_view(), name='Heroes'),
]
\ No newline at end of file
......@@ -6,7 +6,15 @@ class HeroesView(TemplateView):
template_name = 'list_heroes.html'
class HeroView(TemplateView):
template_name = "detail"
class CloudView(TemplateView):
template_name = "detail_cloud.html"
class JesterView(TemplateView):
template_name = "detail_jester.html"
class SunfloweyView(TemplateView):
template_name = "detail_sunflowey.html"
\ No newline at end of file
......@@ -37,6 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'heroes',
]
MIDDLEWARE = [
......
......@@ -13,9 +13,9 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from django.conf.urls import url, include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('heroes.urls')),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment